aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-mm-lantiq.c
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2015-01-18 06:39:30 -0500
committerLinus Walleij <linus.walleij@linaro.org>2015-01-20 05:18:51 -0500
commitda2382218c37fe7f8186c20b6b18aba477ec9b19 (patch)
tree99990da5417591ac9c938685026219540882f152 /drivers/gpio/gpio-mm-lantiq.c
parent68a99b187df3f4675f22a4a3f54c9d7645ab6409 (diff)
gpio: gpio-mm-lantiq: Use of_mm_gpiochip_remove
Since d621e8bae5ac9c67 (Create of_mm_gpiochip_remove), there is a counterpart for of_mm_gpiochip_add. This patch implements the remove function of the driver making use of it. Cc: Alexandre Courbot <gnurou@gmail.com> Cc: John Crispin <blogic@openwrt.org> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-mm-lantiq.c')
-rw-r--r--drivers/gpio/gpio-mm-lantiq.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-mm-lantiq.c b/drivers/gpio/gpio-mm-lantiq.c
index 95ff180d261e..f67ef2283d64 100644
--- a/drivers/gpio/gpio-mm-lantiq.c
+++ b/drivers/gpio/gpio-mm-lantiq.c
@@ -111,6 +111,8 @@ static int ltq_mm_probe(struct platform_device *pdev)
111 if (!chip) 111 if (!chip)
112 return -ENOMEM; 112 return -ENOMEM;
113 113
114 platform_set_drvdata(pdev, chip);
115
114 chip->mmchip.gc.ngpio = 16; 116 chip->mmchip.gc.ngpio = 16;
115 chip->mmchip.gc.direction_output = ltq_mm_dir_out; 117 chip->mmchip.gc.direction_output = ltq_mm_dir_out;
116 chip->mmchip.gc.set = ltq_mm_set; 118 chip->mmchip.gc.set = ltq_mm_set;
@@ -123,6 +125,15 @@ static int ltq_mm_probe(struct platform_device *pdev)
123 return of_mm_gpiochip_add(pdev->dev.of_node, &chip->mmchip); 125 return of_mm_gpiochip_add(pdev->dev.of_node, &chip->mmchip);
124} 126}
125 127
128static int ltq_mm_remove(struct platform_device *pdev)
129{
130 struct ltq_mm *chip = platform_get_drvdata(pdev);
131
132 of_mm_gpiochip_remove(&chip->mmchip);
133
134 return 0;
135}
136
126static const struct of_device_id ltq_mm_match[] = { 137static const struct of_device_id ltq_mm_match[] = {
127 { .compatible = "lantiq,gpio-mm" }, 138 { .compatible = "lantiq,gpio-mm" },
128 {}, 139 {},
@@ -131,6 +142,7 @@ MODULE_DEVICE_TABLE(of, ltq_mm_match);
131 142
132static struct platform_driver ltq_mm_driver = { 143static struct platform_driver ltq_mm_driver = {
133 .probe = ltq_mm_probe, 144 .probe = ltq_mm_probe,
145 .remove = ltq_mm_remove,
134 .driver = { 146 .driver = {
135 .name = "gpio-mm-ltq", 147 .name = "gpio-mm-ltq",
136 .of_match_table = ltq_mm_match, 148 .of_match_table = ltq_mm_match,
@@ -143,3 +155,9 @@ static int __init ltq_mm_init(void)
143} 155}
144 156
145subsys_initcall(ltq_mm_init); 157subsys_initcall(ltq_mm_init);
158
159static void __exit ltq_mm_exit(void)
160{
161 platform_driver_unregister(&ltq_mm_driver);
162}
163module_exit(ltq_mm_exit);