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

gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration

Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.

Also remove the need of driver callback .remove.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alexander Shiyan <shc_work@mail.ru>

+1 -10
+1 -10
drivers/gpio/gpio-74xx-mmio.c
··· 140 140 141 141 platform_set_drvdata(pdev, priv); 142 142 143 - return gpiochip_add_data(&priv->gc, priv); 144 - } 145 - 146 - static int mmio_74xx_gpio_remove(struct platform_device *pdev) 147 - { 148 - struct mmio_74xx_gpio_priv *priv = platform_get_drvdata(pdev); 149 - 150 - gpiochip_remove(&priv->gc); 151 - return 0; 143 + return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv); 152 144 } 153 145 154 146 static struct platform_driver mmio_74xx_gpio_driver = { ··· 149 157 .of_match_table = mmio_74xx_gpio_ids, 150 158 }, 151 159 .probe = mmio_74xx_gpio_probe, 152 - .remove = mmio_74xx_gpio_remove, 153 160 }; 154 161 module_platform_driver(mmio_74xx_gpio_driver); 155 162