gpio: rc5t583: 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:05:40 +0000 (20:35 +0530)
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/gpio/gpio-rc5t583.c

index 1e2d210b33697d55aa75cfe40871a0ddd244752b..1d6100fa312ad94b456d9276f570e024782fa505 100644 (file)
@@ -136,15 +136,8 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, rc5t583_gpio);
 
-       return gpiochip_add_data(&rc5t583_gpio->gpio_chip, rc5t583_gpio);
-}
-
-static int rc5t583_gpio_remove(struct platform_device *pdev)
-{
-       struct rc5t583_gpio *rc5t583_gpio = platform_get_drvdata(pdev);
-
-       gpiochip_remove(&rc5t583_gpio->gpio_chip);
-       return 0;
+       return devm_gpiochip_add_data(&pdev->dev, &rc5t583_gpio->gpio_chip,
+                                     rc5t583_gpio);
 }
 
 static struct platform_driver rc5t583_gpio_driver = {
@@ -152,7 +145,6 @@ static struct platform_driver rc5t583_gpio_driver = {
                .name    = "rc5t583-gpio",
        },
        .probe          = rc5t583_gpio_probe,
-       .remove         = rc5t583_gpio_remove,
 };
 
 static int __init rc5t583_gpio_init(void)