diff options
author | JJ Ding <dgdunix@gmail.com> | 2011-11-29 14:08:41 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-12-01 02:41:42 -0500 |
commit | 4fcdeac5acf4a7a81efc409c02a79a76fa339c27 (patch) | |
tree | 3dec82bc2c8853f06a2f9de2c46f1d330d5a844a /drivers/input | |
parent | 840a746be2beddd2ada0e5ba772147316d071f25 (diff) |
Input: mouse - use macro module_platform_driver()
Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to
save some platform_driver boilerplate code. Use it.
Signed-off-by: JJ Ding <dgdunix@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/amimouse.c | 16 | ||||
-rw-r--r-- | drivers/input/mouse/gpio_mouse.c | 13 | ||||
-rw-r--r-- | drivers/input/mouse/pxa930_trkball.c | 14 |
3 files changed, 4 insertions, 39 deletions
diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c index ff5f61a0fd3a..39be7b82c046 100644 --- a/drivers/input/mouse/amimouse.c +++ b/drivers/input/mouse/amimouse.c | |||
@@ -140,25 +140,13 @@ static int __exit amimouse_remove(struct platform_device *pdev) | |||
140 | } | 140 | } |
141 | 141 | ||
142 | static struct platform_driver amimouse_driver = { | 142 | static struct platform_driver amimouse_driver = { |
143 | .probe = amimouse_probe, | ||
143 | .remove = __exit_p(amimouse_remove), | 144 | .remove = __exit_p(amimouse_remove), |
144 | .driver = { | 145 | .driver = { |
145 | .name = "amiga-mouse", | 146 | .name = "amiga-mouse", |
146 | .owner = THIS_MODULE, | 147 | .owner = THIS_MODULE, |
147 | }, | 148 | }, |
148 | }; | 149 | }; |
149 | 150 | module_platform_driver(amimouse_driver); | |
150 | static int __init amimouse_init(void) | ||
151 | { | ||
152 | return platform_driver_probe(&amimouse_driver, amimouse_probe); | ||
153 | } | ||
154 | |||
155 | module_init(amimouse_init); | ||
156 | |||
157 | static void __exit amimouse_exit(void) | ||
158 | { | ||
159 | platform_driver_unregister(&amimouse_driver); | ||
160 | } | ||
161 | |||
162 | module_exit(amimouse_exit); | ||
163 | 151 | ||
164 | MODULE_ALIAS("platform:amiga-mouse"); | 152 | MODULE_ALIAS("platform:amiga-mouse"); |
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index 58902fbb9896..a9ad8e1402be 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c | |||
@@ -178,18 +178,7 @@ static struct platform_driver gpio_mouse_device_driver = { | |||
178 | .owner = THIS_MODULE, | 178 | .owner = THIS_MODULE, |
179 | } | 179 | } |
180 | }; | 180 | }; |
181 | 181 | module_platform_driver(gpio_mouse_device_driver); | |
182 | static int __init gpio_mouse_init(void) | ||
183 | { | ||
184 | return platform_driver_register(&gpio_mouse_device_driver); | ||
185 | } | ||
186 | module_init(gpio_mouse_init); | ||
187 | |||
188 | static void __exit gpio_mouse_exit(void) | ||
189 | { | ||
190 | platform_driver_unregister(&gpio_mouse_device_driver); | ||
191 | } | ||
192 | module_exit(gpio_mouse_exit); | ||
193 | 182 | ||
194 | MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>"); | 183 | MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>"); |
195 | MODULE_DESCRIPTION("GPIO mouse driver"); | 184 | MODULE_DESCRIPTION("GPIO mouse driver"); |
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c index ee3b0ca9d592..a9e4bfdf31f4 100644 --- a/drivers/input/mouse/pxa930_trkball.c +++ b/drivers/input/mouse/pxa930_trkball.c | |||
@@ -250,19 +250,7 @@ static struct platform_driver pxa930_trkball_driver = { | |||
250 | .probe = pxa930_trkball_probe, | 250 | .probe = pxa930_trkball_probe, |
251 | .remove = __devexit_p(pxa930_trkball_remove), | 251 | .remove = __devexit_p(pxa930_trkball_remove), |
252 | }; | 252 | }; |
253 | 253 | module_platform_driver(pxa930_trkball_driver); | |
254 | static int __init pxa930_trkball_init(void) | ||
255 | { | ||
256 | return platform_driver_register(&pxa930_trkball_driver); | ||
257 | } | ||
258 | |||
259 | static void __exit pxa930_trkball_exit(void) | ||
260 | { | ||
261 | platform_driver_unregister(&pxa930_trkball_driver); | ||
262 | } | ||
263 | |||
264 | module_init(pxa930_trkball_init); | ||
265 | module_exit(pxa930_trkball_exit); | ||
266 | 254 | ||
267 | MODULE_AUTHOR("Yong Yao <yaoyong@marvell.com>"); | 255 | MODULE_AUTHOR("Yong Yao <yaoyong@marvell.com>"); |
268 | MODULE_DESCRIPTION("PXA930 Trackball Mouse Driver"); | 256 | MODULE_DESCRIPTION("PXA930 Trackball Mouse Driver"); |