Skip to content

Commit

Permalink
Input: mc13783-pwrbutton - convert to use module_platform_driver()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Dmitry Torokhov committed Dec 12, 2011
1 parent ff4d049 commit 18b2b18
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/input/misc/mc13783-pwrbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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");
Expand Down

0 comments on commit 18b2b18

Please sign in to comment.