]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio: generic: 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:32 +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-generic.c

index 2a4f2333a50b39674cbb848cddd03481fe79b566..54cddfa98f50b09c0d87a1f8d61031e158be23a2 100644 (file)
@@ -628,15 +628,7 @@ static int bgpio_pdev_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, gc);
 
-       return gpiochip_add_data(gc, NULL);
-}
-
-static int bgpio_pdev_remove(struct platform_device *pdev)
-{
-       struct gpio_chip *gc = platform_get_drvdata(pdev);
-
-       gpiochip_remove(gc);
-       return 0;
+       return devm_gpiochip_add_data(&pdev->dev, gc, NULL);
 }
 
 static const struct platform_device_id bgpio_id_table[] = {
@@ -657,7 +649,6 @@ static struct platform_driver bgpio_driver = {
        },
        .id_table = bgpio_id_table,
        .probe = bgpio_pdev_probe,
-       .remove = bgpio_pdev_remove,
 };
 
 module_platform_driver(bgpio_driver);