From: JJ Ding Date: Tue, 29 Nov 2011 19:08:40 +0000 (-0800) Subject: Input: misc - use macro module_platform_driver() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=840a746be2beddd2ada0e5ba772147316d071f25;p=mv-sheeva.git Input: misc - use macro module_platform_driver() Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to save some platform_driver boilerplate code. Use it. Signed-off-by: JJ Ding Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index 3dca3c14510..f2e0cbc5ab6 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c @@ -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 "); diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index 3d3288a78fd..79d90163363 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c @@ -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 "); diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c index d00edc9f39d..1c4146fccfd 100644 --- a/drivers/input/misc/bfin_rotary.c +++ b/drivers/input/misc/bfin_rotary.c @@ -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 "); diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c index fd8407a2963..53e43d29514 100644 --- a/drivers/input/misc/cobalt_btns.c +++ b/drivers/input/misc/cobalt_btns.c @@ -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); diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c index 7283dd2a1ad..35083c6836c 100644 --- a/drivers/input/misc/dm355evm_keys.c +++ b/drivers/input/misc/dm355evm_keys.c @@ -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"); diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index 302ab46ce75..50e28306830 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c @@ -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); diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c index 7de0ded4ccc..23cf0827104 100644 --- a/drivers/input/misc/max8925_onkey.c +++ b/drivers/input/misc/max8925_onkey.c @@ -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 "); diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c index 99335c28625..e09b4fe8191 100644 --- a/drivers/input/misc/pcap_keys.c +++ b/drivers/input/misc/pcap_keys.c @@ -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 "); diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c index 95562735728..53891de80b0 100644 --- a/drivers/input/misc/pcf50633-input.c +++ b/drivers/input/misc/pcf50633-input.c @@ -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 "); MODULE_DESCRIPTION("PCF50633 input driver"); diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index 34f4d2e0f50..b2484aa07f3 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c @@ -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); diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c index 43192930824..dfbfb463ea5 100644 --- a/drivers/input/misc/pm8xxx-vibrator.c +++ b/drivers/input/misc/pm8xxx-vibrator.c @@ -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"); diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c index b3cfb9c71e6..0f83d0f1d01 100644 --- a/drivers/input/misc/pmic8xxx-pwrkey.c +++ b/drivers/input/misc/pmic8xxx-pwrkey.c @@ -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"); diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c index 57c294f0719..fc84c8a5114 100644 --- a/drivers/input/misc/pwm-beeper.c +++ b/drivers/input/misc/pwm-beeper.c @@ -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 "); MODULE_DESCRIPTION("PWM beeper driver"); diff --git a/drivers/input/misc/rb532_button.c b/drivers/input/misc/rb532_button.c index e2c7f622a0b..aeb02bcf723 100644 --- a/drivers/input/misc/rb532_button.c +++ b/drivers/input/misc/rb532_button.c @@ -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 "); MODULE_LICENSE("GPL"); diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index 2be21694fac..f07f784198b 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c @@ -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"); diff --git a/drivers/input/misc/sgi_btns.c b/drivers/input/misc/sgi_btns.c index 1a80c0dab83..5d9fd557119 100644 --- a/drivers/input/misc/sgi_btns.c +++ b/drivers/input/misc/sgi_btns.c @@ -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); diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index 38e4b507b94..19a68828cd8 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -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"); diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index 3c1a432c14d..37651373a95 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c @@ -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"); diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index ad153a417ee..45874fed523 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -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"); diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index c3d7ba5f5b4..47f18d6bce4 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c @@ -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");