]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
gpio: xgene: 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:54 +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-xgene.c

index 592e9cdf9c5387d270c54a1af2d1c3f57fac8058..c0aa387664bf50bda637a928574c0667f5b76a43 100644 (file)
@@ -193,7 +193,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, gpio);
 
-       err = gpiochip_add_data(&gpio->chip, gpio);
+       err = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
        if (err) {
                dev_err(&pdev->dev,
                        "failed to register gpiochip.\n");
@@ -207,14 +207,6 @@ static int xgene_gpio_probe(struct platform_device *pdev)
        return err;
 }
 
-static int xgene_gpio_remove(struct platform_device *pdev)
-{
-       struct xgene_gpio *gpio = platform_get_drvdata(pdev);
-
-       gpiochip_remove(&gpio->chip);
-       return 0;
-}
-
 static const struct of_device_id xgene_gpio_of_match[] = {
        { .compatible = "apm,xgene-gpio", },
        {},
@@ -228,7 +220,6 @@ static struct platform_driver xgene_gpio_driver = {
                .pm     = XGENE_GPIO_PM_OPS,
        },
        .probe = xgene_gpio_probe,
-       .remove = xgene_gpio_remove,
 };
 
 module_platform_driver(xgene_gpio_driver);