]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio: adp5520: Use devm_gpiochip_add_data() for gpio registration
authorLaxman Dewangan <ldewangan@nvidia.com>
Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Tue, 23 Feb 2016 15:04:06 +0000 (20:34 +0530)
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: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
drivers/gpio/gpio-adp5520.c

index 4fa7ff1fec9ae870a5d45ccbd01a2f3f5fcb3f44..abf1996095465d6be5f8ec4caccbbcfaf1af1066 100644 (file)
@@ -153,7 +153,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
                goto err;
        }
 
-       ret = gpiochip_add_data(&dev->gpio_chip, dev);
+       ret = devm_gpiochip_add_data(&pdev->dev, &dev->gpio_chip, dev);
        if (ret)
                goto err;
 
@@ -164,22 +164,11 @@ err:
        return ret;
 }
 
-static int adp5520_gpio_remove(struct platform_device *pdev)
-{
-       struct adp5520_gpio *dev;
-
-       dev = platform_get_drvdata(pdev);
-       gpiochip_remove(&dev->gpio_chip);
-
-       return 0;
-}
-
 static struct platform_driver adp5520_gpio_driver = {
        .driver = {
                .name   = "adp5520-gpio",
        },
        .probe          = adp5520_gpio_probe,
-       .remove         = adp5520_gpio_remove,
 };
 
 module_platform_driver(adp5520_gpio_driver);