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

index 482aa0353868e3d1e1e395917e42cc7a4b077a6f..a8d0a6b8025a60f820a62674e6780b6b92bb0334 100644 (file)
@@ -182,7 +182,7 @@ static int ttl_probe(struct platform_device *pdev)
        gpio->base = -1;
        gpio->ngpio = 20;
 
-       ret = gpiochip_add_data(gpio, NULL);
+       ret = devm_gpiochip_add_data(dev, gpio, NULL);
        if (ret) {
                dev_err(dev, "unable to add GPIO chip\n");
                return ret;
@@ -191,21 +191,11 @@ static int ttl_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int ttl_remove(struct platform_device *pdev)
-{
-       struct ttl_module *mod = platform_get_drvdata(pdev);
-
-       gpiochip_remove(&mod->gpio);
-
-       return 0;
-}
-
 static struct platform_driver ttl_driver = {
        .driver         = {
                .name   = DRV_NAME,
        },
        .probe          = ttl_probe,
-       .remove         = ttl_remove,
 };
 
 module_platform_driver(ttl_driver);