summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-adp5520.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-02-22 15:13:28 +0300
committerLaxman Dewangan <ldewangan@nvidia.com>2016-02-23 18:04:06 +0300
commit8ae6ace128023c08b475ddd5153761c3765812ab (patch)
tree65310ffa06434655ec632ef83cd33823581beeb7 /drivers/gpio/gpio-adp5520.c
parentdaa994bfe22ed690fb8e377c43faf7e16aad59da (diff)
downloadlinux-8ae6ace128023c08b475ddd5153761c3765812ab.tar.xz
gpio: adp5520: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the call for gpiochip_remove() from error path. Also remove the need of driver callback .remove. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Diffstat (limited to 'drivers/gpio/gpio-adp5520.c')
-rw-r--r--drivers/gpio/gpio-adp5520.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c
index 4fa7ff1fec9a..abf199609546 100644
--- a/drivers/gpio/gpio-adp5520.c
+++ b/drivers/gpio/gpio-adp5520.c
@@ -153,7 +153,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
goto err;
}
- ret = gpiochip_add_data(&dev->gpio_chip, dev);
+ ret = devm_gpiochip_add_data(&pdev->dev, &dev->gpio_chip, dev);
if (ret)
goto err;
@@ -164,22 +164,11 @@ err:
return ret;
}
-static int adp5520_gpio_remove(struct platform_device *pdev)
-{
- struct adp5520_gpio *dev;
-
- dev = platform_get_drvdata(pdev);
- gpiochip_remove(&dev->gpio_chip);
-
- return 0;
-}
-
static struct platform_driver adp5520_gpio_driver = {
.driver = {
.name = "adp5520-gpio",
},
.probe = adp5520_gpio_probe,
- .remove = adp5520_gpio_remove,
};
module_platform_driver(adp5520_gpio_driver);