From: Laxman Dewangan Date: Mon, 22 Feb 2016 12:13:28 +0000 (+0530) Subject: gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a718ed2cfed0faba89b4bb9fa9f1ab5957891de9;p=linux-beck.git 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 Cc: Alexander Shiyan --- diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c index 372b0e01adc6..0475e8ec96d0 100644 --- a/drivers/gpio/gpio-74xx-mmio.c +++ b/drivers/gpio/gpio-74xx-mmio.c @@ -140,15 +140,7 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - return gpiochip_add_data(&priv->gc, priv); -} - -static int mmio_74xx_gpio_remove(struct platform_device *pdev) -{ - struct mmio_74xx_gpio_priv *priv = platform_get_drvdata(pdev); - - gpiochip_remove(&priv->gc); - return 0; + return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv); } static struct platform_driver mmio_74xx_gpio_driver = { @@ -157,7 +149,6 @@ static struct platform_driver mmio_74xx_gpio_driver = { .of_match_table = mmio_74xx_gpio_ids, }, .probe = mmio_74xx_gpio_probe, - .remove = mmio_74xx_gpio_remove, }; module_platform_driver(mmio_74xx_gpio_driver);