aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);