diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-02-22 15:13:28 +0300 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2016-02-23 18:05:40 +0300 |
commit | 297bf067eca3cefc944493a517f593bf67dd1e52 (patch) | |
tree | d23b5bd61d5ef8c68d1727fc0ea6751b5f73c4d6 /drivers/gpio/gpio-palmas.c | |
parent | 3aebfc9bd81a4a8d23e494732d8e88ae174de2cd (diff) | |
download | linux-297bf067eca3cefc944493a517f593bf67dd1e52.tar.xz |
gpio: palmas: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/gpio/gpio-palmas.c')
-rw-r--r-- | drivers/gpio/gpio-palmas.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c index fdfb3b1e0def..6f27b3d94d53 100644 --- a/drivers/gpio/gpio-palmas.c +++ b/drivers/gpio/gpio-palmas.c @@ -195,7 +195,8 @@ static int palmas_gpio_probe(struct platform_device *pdev) else palmas_gpio->gpio_chip.base = -1; - ret = gpiochip_add_data(&palmas_gpio->gpio_chip, palmas_gpio); + ret = devm_gpiochip_add_data(&pdev->dev, &palmas_gpio->gpio_chip, + palmas_gpio); if (ret < 0) { dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); return ret; @@ -205,20 +206,11 @@ static int palmas_gpio_probe(struct platform_device *pdev) return ret; } -static int palmas_gpio_remove(struct platform_device *pdev) -{ - struct palmas_gpio *palmas_gpio = platform_get_drvdata(pdev); - - gpiochip_remove(&palmas_gpio->gpio_chip); - return 0; -} - static struct platform_driver palmas_gpio_driver = { .driver.name = "palmas-gpio", .driver.owner = THIS_MODULE, .driver.of_match_table = of_palmas_gpio_match, .probe = palmas_gpio_probe, - .remove = palmas_gpio_remove, }; static int __init palmas_gpio_init(void) |