Input: mouse - use macro module_platform_driver()
authorJJ Ding <dgdunix@gmail.com>
Tue, 29 Nov 2011 19:08:41 +0000 (11:08 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 1 Dec 2011 07:41:42 +0000 (23:41 -0800)
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>
drivers/input/mouse/amimouse.c
drivers/input/mouse/gpio_mouse.c
drivers/input/mouse/pxa930_trkball.c

index ff5f61a0fd3ad1eb071e600e5e37fb15fb4ca61a..39be7b82c046ac9b9129678631077aa5cf5e37e8 100644 (file)
@@ -140,25 +140,13 @@ static int __exit amimouse_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver amimouse_driver = {
+       .probe = amimouse_probe,
        .remove = __exit_p(amimouse_remove),
        .driver   = {
                .name   = "amiga-mouse",
                .owner  = THIS_MODULE,
        },
 };
-
-static int __init amimouse_init(void)
-{
-       return platform_driver_probe(&amimouse_driver, amimouse_probe);
-}
-
-module_init(amimouse_init);
-
-static void __exit amimouse_exit(void)
-{
-       platform_driver_unregister(&amimouse_driver);
-}
-
-module_exit(amimouse_exit);
+module_platform_driver(amimouse_driver);
 
 MODULE_ALIAS("platform:amiga-mouse");
index 58902fbb98967a7b456fa71d0155ee65b51003bd..a9ad8e1402be217786574e88146d6e5d652a1e8e 100644 (file)
@@ -178,18 +178,7 @@ static struct platform_driver gpio_mouse_device_driver = {
                .owner  = THIS_MODULE,
        }
 };
-
-static int __init gpio_mouse_init(void)
-{
-       return platform_driver_register(&gpio_mouse_device_driver);
-}
-module_init(gpio_mouse_init);
-
-static void __exit gpio_mouse_exit(void)
-{
-       platform_driver_unregister(&gpio_mouse_device_driver);
-}
-module_exit(gpio_mouse_exit);
+module_platform_driver(gpio_mouse_device_driver);
 
 MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
 MODULE_DESCRIPTION("GPIO mouse driver");
index ee3b0ca9d592b05286ff44dd2b90fadb8b07b193..a9e4bfdf31f4e5906a5b3d5b5a975d315b4f25bc 100644 (file)
@@ -250,19 +250,7 @@ static struct platform_driver pxa930_trkball_driver = {
        .probe          = pxa930_trkball_probe,
        .remove         = __devexit_p(pxa930_trkball_remove),
 };
-
-static int __init pxa930_trkball_init(void)
-{
-       return platform_driver_register(&pxa930_trkball_driver);
-}
-
-static void __exit pxa930_trkball_exit(void)
-{
-       platform_driver_unregister(&pxa930_trkball_driver);
-}
-
-module_init(pxa930_trkball_init);
-module_exit(pxa930_trkball_exit);
+module_platform_driver(pxa930_trkball_driver);
 
 MODULE_AUTHOR("Yong Yao <yaoyong@marvell.com>");
 MODULE_DESCRIPTION("PXA930 Trackball Mouse Driver");