summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-tps65218.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-09-15 21:51:10 -0400
committerLinus Walleij <linus.walleij@linaro.org>2016-09-18 07:18:13 -0400
commit8df759c9e66d91507b653433b14ef2216d19ee29 (patch)
tree8f6e60e951e99e9ba3bd05edfec52224fb4c4857 /drivers/gpio/gpio-tps65218.c
parent7f8b96570291def5104cec6f68bae09bd55b691a (diff)
gpio: tps65218: 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: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tps65218.c')
-rw-r--r--drivers/gpio/gpio-tps65218.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-tps65218.c b/drivers/gpio/gpio-tps65218.c
index 03e0dfbe9720..d779307a9685 100644
--- a/drivers/gpio/gpio-tps65218.c
+++ b/drivers/gpio/gpio-tps65218.c
@@ -204,7 +204,8 @@ static int tps65218_gpio_probe(struct platform_device *pdev)
204 tps65218_gpio->gpio_chip.of_node = pdev->dev.of_node; 204 tps65218_gpio->gpio_chip.of_node = pdev->dev.of_node;
205#endif 205#endif
206 206
207 ret = gpiochip_add_data(&tps65218_gpio->gpio_chip, tps65218_gpio); 207 ret = devm_gpiochip_add_data(&pdev->dev, &tps65218_gpio->gpio_chip,
208 tps65218_gpio);
208 if (ret < 0) { 209 if (ret < 0) {
209 dev_err(&pdev->dev, "Failed to register gpiochip, %d\n", ret); 210 dev_err(&pdev->dev, "Failed to register gpiochip, %d\n", ret);
210 return ret; 211 return ret;
@@ -215,15 +216,6 @@ static int tps65218_gpio_probe(struct platform_device *pdev)
215 return ret; 216 return ret;
216} 217}
217 218
218static int tps65218_gpio_remove(struct platform_device *pdev)
219{
220 struct tps65218_gpio *tps65218_gpio = platform_get_drvdata(pdev);
221
222 gpiochip_remove(&tps65218_gpio->gpio_chip);
223
224 return 0;
225}
226
227static const struct of_device_id tps65218_dt_match[] = { 219static const struct of_device_id tps65218_dt_match[] = {
228 { .compatible = "ti,tps65218-gpio" }, 220 { .compatible = "ti,tps65218-gpio" },
229 { } 221 { }
@@ -242,7 +234,6 @@ static struct platform_driver tps65218_gpio_driver = {
242 .of_match_table = of_match_ptr(tps65218_dt_match) 234 .of_match_table = of_match_ptr(tps65218_dt_match)
243 }, 235 },
244 .probe = tps65218_gpio_probe, 236 .probe = tps65218_gpio_probe,
245 .remove = tps65218_gpio_remove,
246 .id_table = tps65218_gpio_id_table, 237 .id_table = tps65218_gpio_id_table,
247}; 238};
248 239