提交 8ae6ace1 编写于 作者: L Laxman Dewangan

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: NLaxman Dewangan <ldewangan@nvidia.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: NMichael Hennerich <michael.hennerich@analog.com>
上级 daa994bf
...@@ -153,7 +153,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev) ...@@ -153,7 +153,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
goto err; goto err;
} }
ret = gpiochip_add_data(&dev->gpio_chip, dev); ret = devm_gpiochip_add_data(&pdev->dev, &dev->gpio_chip, dev);
if (ret) if (ret)
goto err; goto err;
...@@ -164,22 +164,11 @@ static int adp5520_gpio_probe(struct platform_device *pdev) ...@@ -164,22 +164,11 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
return ret; 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 = { static struct platform_driver adp5520_gpio_driver = {
.driver = { .driver = {
.name = "adp5520-gpio", .name = "adp5520-gpio",
}, },
.probe = adp5520_gpio_probe, .probe = adp5520_gpio_probe,
.remove = adp5520_gpio_remove,
}; };
module_platform_driver(adp5520_gpio_driver); module_platform_driver(adp5520_gpio_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册