diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-12 02:43:32 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-12-12 03:02:51 -0500 |
commit | 18b2b1813f51a314d2468d0c103e593936e5f534 (patch) | |
tree | 4590025d96904e724eb43fa92fcf17baad8f6cfd /drivers/input | |
parent | ff4d049246727087ee797b6802e7c1bd4d5d172c (diff) |
Input: mc13783-pwrbutton - convert to use module_platform_driver()
This patch converts mc13783-pwrbutton to use the module_platform_driver()
macro which makes the code smaller and a bit simpler.
Also staticise mc13783_pwrbutton_driver which is not used outside
this driver so no need to make the symbol global.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/mc13783-pwrbutton.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c index 09b052288657..8428f1e8e83e 100644 --- a/drivers/input/misc/mc13783-pwrbutton.c +++ b/drivers/input/misc/mc13783-pwrbutton.c | |||
@@ -255,7 +255,7 @@ static int __devexit mc13783_pwrbutton_remove(struct platform_device *pdev) | |||
255 | return 0; | 255 | return 0; |
256 | } | 256 | } |
257 | 257 | ||
258 | struct platform_driver mc13783_pwrbutton_driver = { | 258 | static struct platform_driver mc13783_pwrbutton_driver = { |
259 | .probe = mc13783_pwrbutton_probe, | 259 | .probe = mc13783_pwrbutton_probe, |
260 | .remove = __devexit_p(mc13783_pwrbutton_remove), | 260 | .remove = __devexit_p(mc13783_pwrbutton_remove), |
261 | .driver = { | 261 | .driver = { |
@@ -264,17 +264,7 @@ struct platform_driver mc13783_pwrbutton_driver = { | |||
264 | }, | 264 | }, |
265 | }; | 265 | }; |
266 | 266 | ||
267 | static int __init mc13783_pwrbutton_init(void) | 267 | module_platform_driver(mc13783_pwrbutton_driver); |
268 | { | ||
269 | return platform_driver_register(&mc13783_pwrbutton_driver); | ||
270 | } | ||
271 | module_init(mc13783_pwrbutton_init); | ||
272 | |||
273 | static void __exit mc13783_pwrbutton_exit(void) | ||
274 | { | ||
275 | platform_driver_unregister(&mc13783_pwrbutton_driver); | ||
276 | } | ||
277 | module_exit(mc13783_pwrbutton_exit); | ||
278 | 268 | ||
279 | MODULE_ALIAS("platform:mc13783-pwrbutton"); | 269 | MODULE_ALIAS("platform:mc13783-pwrbutton"); |
280 | MODULE_DESCRIPTION("MC13783 Power Button"); | 270 | MODULE_DESCRIPTION("MC13783 Power Button"); |