Skip to contentSkip to conversation

Input: mc13783-pwrbutton - convert to use module_platform_driver()

PATCH Applied Axel Lin 2 participants 2 messages Dec 9, 2011 – Dec 12, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/input/misc/mc13783-pwrbutton.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
drivers/input/misc/mc13783-pwrbutton.c +2 -12
index 09b0522..8428f1e 100644
@@ -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");
Signature · 1 line
1.7.5.4
maintainer Applied
#1 lore raw
Quoted 6 lines · Axel Lin

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.

Applied, thank you Axel.

Signature · 1 line
Dmitry