linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: mc13783-pwrbutton - convert to use module_platform_driver()
@ 2011-12-09  2:14 Axel Lin
  2011-12-12  7:43 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2011-12-09  2:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dmitry Torokhov, Uwe Kleine-König, linux-input

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>
---
 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 09b0522..8428f1e 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)
 	return 0;
 }
 
-struct platform_driver mc13783_pwrbutton_driver = {
+static struct platform_driver mc13783_pwrbutton_driver = {
 	.probe		= mc13783_pwrbutton_probe,
 	.remove		= __devexit_p(mc13783_pwrbutton_remove),
 	.driver		= {
@@ -264,17 +264,7 @@ struct platform_driver mc13783_pwrbutton_driver = {
 	},
 };
 
-static int __init mc13783_pwrbutton_init(void)
-{
-	return platform_driver_register(&mc13783_pwrbutton_driver);
-}
-module_init(mc13783_pwrbutton_init);
-
-static void __exit mc13783_pwrbutton_exit(void)
-{
-	platform_driver_unregister(&mc13783_pwrbutton_driver);
-}
-module_exit(mc13783_pwrbutton_exit);
+module_platform_driver(mc13783_pwrbutton_driver);
 
 MODULE_ALIAS("platform:mc13783-pwrbutton");
 MODULE_DESCRIPTION("MC13783 Power Button");
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-12  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-09  2:14 [PATCH] Input: mc13783-pwrbutton - convert to use module_platform_driver() Axel Lin
2011-12-12  7:43 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).