Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'ib-mfd-gpio-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next

Immutable branch between MFD and GPIO due for the v6.18 merge window

Convert GPIO drivers under drivers/mfd/ to using the modernized generic
GPIO chip API.

+20 -5
+20 -5
drivers/mfd/vexpress-sysreg.c
··· 5 5 */ 6 6 7 7 #include <linux/gpio/driver.h> 8 + #include <linux/gpio/generic.h> 8 9 #include <linux/err.h> 9 10 #include <linux/io.h> 10 11 #include <linux/mfd/core.h> ··· 97 96 98 97 static int vexpress_sysreg_probe(struct platform_device *pdev) 99 98 { 99 + struct gpio_generic_chip *mmc_gpio_chip; 100 + struct gpio_generic_chip_config config; 100 101 struct resource *mem; 101 102 void __iomem *base; 102 - struct gpio_chip *mmc_gpio_chip; 103 + int ret; 103 104 104 105 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 105 106 if (!mem) ··· 119 116 GFP_KERNEL); 120 117 if (!mmc_gpio_chip) 121 118 return -ENOMEM; 122 - bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI, 123 - NULL, NULL, NULL, NULL, 0); 124 - mmc_gpio_chip->ngpio = 2; 125 - devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL); 119 + 120 + config = (typeof(config)){ 121 + .dev = &pdev->dev, 122 + .sz = 4, 123 + .dat = base + SYS_MCI, 124 + }; 125 + 126 + ret = gpio_generic_chip_init(mmc_gpio_chip, &config); 127 + if (ret) 128 + return ret; 129 + 130 + mmc_gpio_chip->gc.ngpio = 2; 131 + 132 + ret = devm_gpiochip_add_data(&pdev->dev, &mmc_gpio_chip->gc, NULL); 133 + if (ret) 134 + return ret; 126 135 127 136 return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, 128 137 vexpress_sysreg_cells,