Input: misc - use macro module_platform_driver()
authorJJ Ding <dgdunix@gmail.com>
Tue, 29 Nov 2011 19:08:40 +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>
20 files changed:
drivers/input/misc/88pm860x_onkey.c
drivers/input/misc/ab8500-ponkey.c
drivers/input/misc/bfin_rotary.c
drivers/input/misc/cobalt_btns.c
drivers/input/misc/dm355evm_keys.c
drivers/input/misc/ixp4xx-beeper.c
drivers/input/misc/max8925_onkey.c
drivers/input/misc/pcap_keys.c
drivers/input/misc/pcf50633-input.c
drivers/input/misc/pcspkr.c
drivers/input/misc/pm8xxx-vibrator.c
drivers/input/misc/pmic8xxx-pwrkey.c
drivers/input/misc/pwm-beeper.c
drivers/input/misc/rb532_button.c
drivers/input/misc/rotary_encoder.c
drivers/input/misc/sgi_btns.c
drivers/input/misc/twl4030-pwrbutton.c
drivers/input/misc/twl4030-vibra.c
drivers/input/misc/twl6040-vibra.c
drivers/input/misc/wm831x-on.c

index 3dca3c14510e055be3925d9552cd79e181ef91cd..f2e0cbc5ab646c76267731f1a1280041ba50c1ca 100644 (file)
@@ -137,18 +137,7 @@ static struct platform_driver pm860x_onkey_driver = {
        .probe          = pm860x_onkey_probe,
        .remove         = __devexit_p(pm860x_onkey_remove),
 };
-
-static int __init pm860x_onkey_init(void)
-{
-       return platform_driver_register(&pm860x_onkey_driver);
-}
-module_init(pm860x_onkey_init);
-
-static void __exit pm860x_onkey_exit(void)
-{
-       platform_driver_unregister(&pm860x_onkey_driver);
-}
-module_exit(pm860x_onkey_exit);
+module_platform_driver(pm860x_onkey_driver);
 
 MODULE_DESCRIPTION("Marvell 88PM860x ONKEY driver");
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
index 3d3288a78fdc66d4fcbf71f26f518e19581e45c9..79d9016336355a4885681ca68a2a0249b3b5894e 100644 (file)
@@ -139,18 +139,7 @@ static struct platform_driver ab8500_ponkey_driver = {
        .probe          = ab8500_ponkey_probe,
        .remove         = __devexit_p(ab8500_ponkey_remove),
 };
-
-static int __init ab8500_ponkey_init(void)
-{
-       return platform_driver_register(&ab8500_ponkey_driver);
-}
-module_init(ab8500_ponkey_init);
-
-static void __exit ab8500_ponkey_exit(void)
-{
-       platform_driver_unregister(&ab8500_ponkey_driver);
-}
-module_exit(ab8500_ponkey_exit);
+module_platform_driver(ab8500_ponkey_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>");
index d00edc9f39d10e38a455579d3a58c8deb96c4216..1c4146fccfdf53d7fd93a5e152998a3fabced2fa 100644 (file)
@@ -264,18 +264,7 @@ static struct platform_driver bfin_rotary_device_driver = {
 #endif
        },
 };
-
-static int __init bfin_rotary_init(void)
-{
-       return platform_driver_register(&bfin_rotary_device_driver);
-}
-module_init(bfin_rotary_init);
-
-static void __exit bfin_rotary_exit(void)
-{
-       platform_driver_unregister(&bfin_rotary_device_driver);
-}
-module_exit(bfin_rotary_exit);
+module_platform_driver(bfin_rotary_device_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
index fd8407a29631030b1f4a088f01e214b46eb9a4f5..53e43d295148a25bcbb0b3eced305a1889be2448 100644 (file)
@@ -163,16 +163,4 @@ static struct platform_driver cobalt_buttons_driver = {
                .owner  = THIS_MODULE,
        },
 };
-
-static int __init cobalt_buttons_init(void)
-{
-       return platform_driver_register(&cobalt_buttons_driver);
-}
-
-static void __exit cobalt_buttons_exit(void)
-{
-       platform_driver_unregister(&cobalt_buttons_driver);
-}
-
-module_init(cobalt_buttons_init);
-module_exit(cobalt_buttons_exit);
+module_platform_driver(cobalt_buttons_driver);
index 7283dd2a1ad3b89d349cd80897f204b5dccbe661..35083c6836c351ba5110f6fe3ec0cecc98b074e9 100644 (file)
@@ -267,17 +267,6 @@ static struct platform_driver dm355evm_keys_driver = {
                .name   = "dm355evm_keys",
        },
 };
-
-static int __init dm355evm_keys_init(void)
-{
-       return platform_driver_register(&dm355evm_keys_driver);
-}
-module_init(dm355evm_keys_init);
-
-static void __exit dm355evm_keys_exit(void)
-{
-       platform_driver_unregister(&dm355evm_keys_driver);
-}
-module_exit(dm355evm_keys_exit);
+module_platform_driver(dm355evm_keys_driver);
 
 MODULE_LICENSE("GPL");
index 302ab46ce75201bbf0025a6730155fc414ce4fa6..50e283068301db05ad34bff8b839c4773bb3b747 100644 (file)
@@ -168,16 +168,5 @@ static struct platform_driver ixp4xx_spkr_platform_driver = {
        .remove         = __devexit_p(ixp4xx_spkr_remove),
        .shutdown       = ixp4xx_spkr_shutdown,
 };
+module_platform_driver(ixp4xx_spkr_platform_driver);
 
-static int __init ixp4xx_spkr_init(void)
-{
-       return platform_driver_register(&ixp4xx_spkr_platform_driver);
-}
-
-static void __exit ixp4xx_spkr_exit(void)
-{
-       platform_driver_unregister(&ixp4xx_spkr_platform_driver);
-}
-
-module_init(ixp4xx_spkr_init);
-module_exit(ixp4xx_spkr_exit);
index 7de0ded4ccc382ed3b90b16c302176be980eb59b..23cf08271049d9225a43147c7a3a500817321760 100644 (file)
@@ -166,18 +166,7 @@ static struct platform_driver max8925_onkey_driver = {
        .probe          = max8925_onkey_probe,
        .remove         = __devexit_p(max8925_onkey_remove),
 };
-
-static int __init max8925_onkey_init(void)
-{
-       return platform_driver_register(&max8925_onkey_driver);
-}
-module_init(max8925_onkey_init);
-
-static void __exit max8925_onkey_exit(void)
-{
-       platform_driver_unregister(&max8925_onkey_driver);
-}
-module_exit(max8925_onkey_exit);
+module_platform_driver(max8925_onkey_driver);
 
 MODULE_DESCRIPTION("Maxim MAX8925 ONKEY driver");
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
index 99335c286250594933967ea3132aba3a948b4b4f..e09b4fe81913ad89f9de7b8b59ed1c36a013962c 100644 (file)
@@ -125,19 +125,7 @@ static struct platform_driver pcap_keys_device_driver = {
                .owner  = THIS_MODULE,
        }
 };
-
-static int __init pcap_keys_init(void)
-{
-       return platform_driver_register(&pcap_keys_device_driver);
-};
-
-static void __exit pcap_keys_exit(void)
-{
-       platform_driver_unregister(&pcap_keys_device_driver);
-};
-
-module_init(pcap_keys_init);
-module_exit(pcap_keys_exit);
+module_platform_driver(pcap_keys_device_driver);
 
 MODULE_DESCRIPTION("Motorola PCAP2 input events driver");
 MODULE_AUTHOR("Ilya Petrov <ilya.muromec@gmail.com>");
index 95562735728d6d5c2f472767284b778546ab529c..53891de80b0e6ded0473b61e59c52c1640746a0d 100644 (file)
@@ -113,18 +113,7 @@ static struct platform_driver pcf50633_input_driver = {
        .probe = pcf50633_input_probe,
        .remove = __devexit_p(pcf50633_input_remove),
 };
-
-static int __init pcf50633_input_init(void)
-{
-       return platform_driver_register(&pcf50633_input_driver);
-}
-module_init(pcf50633_input_init);
-
-static void __exit pcf50633_input_exit(void)
-{
-       platform_driver_unregister(&pcf50633_input_driver);
-}
-module_exit(pcf50633_input_exit);
+module_platform_driver(pcf50633_input_driver);
 
 MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
 MODULE_DESCRIPTION("PCF50633 input driver");
index 34f4d2e0f50f45cc3cd526e67360b1dafd527ffc..b2484aa07f32fe68565a14501f0267dfb59c5040 100644 (file)
@@ -134,17 +134,5 @@ static struct platform_driver pcspkr_platform_driver = {
        .remove         = __devexit_p(pcspkr_remove),
        .shutdown       = pcspkr_shutdown,
 };
+module_platform_driver(pcspkr_platform_driver);
 
-
-static int __init pcspkr_init(void)
-{
-       return platform_driver_register(&pcspkr_platform_driver);
-}
-
-static void __exit pcspkr_exit(void)
-{
-       platform_driver_unregister(&pcspkr_platform_driver);
-}
-
-module_init(pcspkr_init);
-module_exit(pcspkr_exit);
index 43192930824bce380f0ffeb563ff8b026d23d11d..dfbfb463ea5d22844ea5c247bbbc0cf6644b44ea 100644 (file)
@@ -277,18 +277,7 @@ static struct platform_driver pm8xxx_vib_driver = {
                .pm     = &pm8xxx_vib_pm_ops,
        },
 };
-
-static int __init pm8xxx_vib_init(void)
-{
-       return platform_driver_register(&pm8xxx_vib_driver);
-}
-module_init(pm8xxx_vib_init);
-
-static void __exit pm8xxx_vib_exit(void)
-{
-       platform_driver_unregister(&pm8xxx_vib_driver);
-}
-module_exit(pm8xxx_vib_exit);
+module_platform_driver(pm8xxx_vib_driver);
 
 MODULE_ALIAS("platform:pm8xxx_vib");
 MODULE_DESCRIPTION("PMIC8xxx vibrator driver based on ff-memless framework");
index b3cfb9c71e664244f85bb77427e13ca01a932d20..0f83d0f1d015c3f6ed9f4b6aaeaaab85cb63d29a 100644 (file)
@@ -213,18 +213,7 @@ static struct platform_driver pmic8xxx_pwrkey_driver = {
                .pm     = &pm8xxx_pwr_key_pm_ops,
        },
 };
-
-static int __init pmic8xxx_pwrkey_init(void)
-{
-       return platform_driver_register(&pmic8xxx_pwrkey_driver);
-}
-module_init(pmic8xxx_pwrkey_init);
-
-static void __exit pmic8xxx_pwrkey_exit(void)
-{
-       platform_driver_unregister(&pmic8xxx_pwrkey_driver);
-}
-module_exit(pmic8xxx_pwrkey_exit);
+module_platform_driver(pmic8xxx_pwrkey_driver);
 
 MODULE_ALIAS("platform:pmic8xxx_pwrkey");
 MODULE_DESCRIPTION("PMIC8XXX Power Key driver");
index 57c294f071984ddfe6e14c12dbb4dfb037e7fd2f..fc84c8a51147c098ed70bd0dd949dd375754272e 100644 (file)
@@ -180,18 +180,7 @@ static struct platform_driver pwm_beeper_driver = {
                .pm     = PWM_BEEPER_PM_OPS,
        },
 };
-
-static int __init pwm_beeper_init(void)
-{
-       return platform_driver_register(&pwm_beeper_driver);
-}
-module_init(pwm_beeper_init);
-
-static void __exit pwm_beeper_exit(void)
-{
-       platform_driver_unregister(&pwm_beeper_driver);
-}
-module_exit(pwm_beeper_exit);
+module_platform_driver(pwm_beeper_driver);
 
 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
 MODULE_DESCRIPTION("PWM beeper driver");
index e2c7f622a0b5b98521f507ae5c64863b58b11cec..aeb02bcf7233a3d1d4383bfd14de04a6d9630d75 100644 (file)
@@ -100,19 +100,7 @@ static struct platform_driver rb532_button_driver = {
                .owner = THIS_MODULE,
        },
 };
-
-static int __init rb532_button_init(void)
-{
-       return platform_driver_register(&rb532_button_driver);
-}
-
-static void __exit rb532_button_exit(void)
-{
-       platform_driver_unregister(&rb532_button_driver);
-}
-
-module_init(rb532_button_init);
-module_exit(rb532_button_exit);
+module_platform_driver(rb532_button_driver);
 
 MODULE_AUTHOR("Phil Sutter <n0-1@freewrt.org>");
 MODULE_LICENSE("GPL");
index 2be21694fac1bf1f66a6189cbd6ea96844a75c28..f07f784198b9e81139f8ed5a192f17578cdf6c75 100644 (file)
@@ -284,19 +284,7 @@ static struct platform_driver rotary_encoder_driver = {
                .owner  = THIS_MODULE,
        }
 };
-
-static int __init rotary_encoder_init(void)
-{
-       return platform_driver_register(&rotary_encoder_driver);
-}
-
-static void __exit rotary_encoder_exit(void)
-{
-       platform_driver_unregister(&rotary_encoder_driver);
-}
-
-module_init(rotary_encoder_init);
-module_exit(rotary_encoder_exit);
+module_platform_driver(rotary_encoder_driver);
 
 MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_DESCRIPTION("GPIO rotary encoder driver");
index 1a80c0dab83bce0204a6532413a759d830451fdc..5d9fd55711991bfb1a701eb0f8ba26dd03b4687d 100644 (file)
@@ -164,17 +164,6 @@ static struct platform_driver sgi_buttons_driver = {
                .owner  = THIS_MODULE,
        },
 };
-
-static int __init sgi_buttons_init(void)
-{
-       return platform_driver_register(&sgi_buttons_driver);
-}
-
-static void __exit sgi_buttons_exit(void)
-{
-       platform_driver_unregister(&sgi_buttons_driver);
-}
+module_platform_driver(sgi_buttons_driver);
 
 MODULE_LICENSE("GPL");
-module_init(sgi_buttons_init);
-module_exit(sgi_buttons_exit);
index 38e4b507b94cc629ef330cf173b1b41d3765e904..19a68828cd865d0812ae57e2305dea1432bee912 100644 (file)
@@ -107,25 +107,14 @@ static int __exit twl4030_pwrbutton_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver twl4030_pwrbutton_driver = {
+       .probe          = twl4030_pwrbutton_probe,
        .remove         = __exit_p(twl4030_pwrbutton_remove),
        .driver         = {
                .name   = "twl4030_pwrbutton",
                .owner  = THIS_MODULE,
        },
 };
-
-static int __init twl4030_pwrbutton_init(void)
-{
-       return platform_driver_probe(&twl4030_pwrbutton_driver,
-                       twl4030_pwrbutton_probe);
-}
-module_init(twl4030_pwrbutton_init);
-
-static void __exit twl4030_pwrbutton_exit(void)
-{
-       platform_driver_unregister(&twl4030_pwrbutton_driver);
-}
-module_exit(twl4030_pwrbutton_exit);
+module_platform_driver(twl4030_pwrbutton_driver);
 
 MODULE_ALIAS("platform:twl4030_pwrbutton");
 MODULE_DESCRIPTION("Triton2 Power Button");
index 3c1a432c14dc3a8f5eadd4540f247d669ba773dd..37651373a95b0ebb19d25ca32cfcd62599ee4a9b 100644 (file)
@@ -278,21 +278,9 @@ static struct platform_driver twl4030_vibra_driver = {
 #endif
        },
 };
-
-static int __init twl4030_vibra_init(void)
-{
-       return platform_driver_register(&twl4030_vibra_driver);
-}
-module_init(twl4030_vibra_init);
-
-static void __exit twl4030_vibra_exit(void)
-{
-       platform_driver_unregister(&twl4030_vibra_driver);
-}
-module_exit(twl4030_vibra_exit);
+module_platform_driver(twl4030_vibra_driver);
 
 MODULE_ALIAS("platform:twl4030-vibra");
-
 MODULE_DESCRIPTION("TWL4030 Vibra driver");
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Nokia Corporation");
index ad153a417eed98a7fff70945f684becc76581b96..45874fed523ab771e94f8b3d9dccf415b8cfa6af 100644 (file)
@@ -410,18 +410,7 @@ static struct platform_driver twl6040_vibra_driver = {
                .pm     = &twl6040_vibra_pm_ops,
        },
 };
-
-static int __init twl6040_vibra_init(void)
-{
-       return platform_driver_register(&twl6040_vibra_driver);
-}
-module_init(twl6040_vibra_init);
-
-static void __exit twl6040_vibra_exit(void)
-{
-       platform_driver_unregister(&twl6040_vibra_driver);
-}
-module_exit(twl6040_vibra_exit);
+module_platform_driver(twl6040_vibra_driver);
 
 MODULE_ALIAS("platform:twl6040-vibra");
 MODULE_DESCRIPTION("TWL6040 Vibra driver");
index c3d7ba5f5b47037c3b8c46b62ca7d6ad931e62db..47f18d6bce46826160e653821d7be213223c4bb4 100644 (file)
@@ -145,18 +145,7 @@ static struct platform_driver wm831x_on_driver = {
                .owner  = THIS_MODULE,
        },
 };
-
-static int __init wm831x_on_init(void)
-{
-       return platform_driver_register(&wm831x_on_driver);
-}
-module_init(wm831x_on_init);
-
-static void __exit wm831x_on_exit(void)
-{
-       platform_driver_unregister(&wm831x_on_driver);
-}
-module_exit(wm831x_on_exit);
+module_platform_driver(wm831x_on_driver);
 
 MODULE_ALIAS("platform:wm831x-on");
 MODULE_DESCRIPTION("WM831x ON pin");