gpio: syscon: 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:44 +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-syscon.c

index e5c5b62058863a60b36cf7aa38e0e865b29daafb..24b6d643ecdbf82188a7c136420ec6e074a9403b 100644 (file)
@@ -238,15 +238,7 @@ static int syscon_gpio_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, priv);
 
-       return gpiochip_add_data(&priv->chip, priv);
-}
-
-static int syscon_gpio_remove(struct platform_device *pdev)
-{
-       struct syscon_gpio_priv *priv = platform_get_drvdata(pdev);
-
-       gpiochip_remove(&priv->chip);
-       return 0;
+       return devm_gpiochip_add_data(&pdev->dev, &priv->chip, priv);
 }
 
 static struct platform_driver syscon_gpio_driver = {
@@ -255,7 +247,6 @@ static struct platform_driver syscon_gpio_driver = {
                .of_match_table = syscon_gpio_ids,
        },
        .probe  = syscon_gpio_probe,
-       .remove = syscon_gpio_remove,
 };
 module_platform_driver(syscon_gpio_driver);