From 9891b1ce6276912c54f66b7b0c8c1bcc42ca75eb Mon Sep 17 00:00:00 2001 From: Marc Dietrich Date: Sun, 24 Jun 2012 23:25:18 +0200 Subject: [PATCH] staging: nvec: cleanup driver registration This patch simplifies code by using the module_platform_driver macro. Signed-off-by: Marc Dietrich Signed-off-by: Greg Kroah-Hartman --- drivers/staging/nvec/nvec.c | 7 +------ drivers/staging/nvec/nvec_kbd.c | 7 +------ drivers/staging/nvec/nvec_leds.c | 14 +------------- drivers/staging/nvec/nvec_power.c | 7 +------ drivers/staging/nvec/nvec_ps2.c | 7 +------ 5 files changed, 5 insertions(+), 37 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 39dbaa0ac6a0..09b7e129fc27 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -917,12 +917,7 @@ static struct platform_driver nvec_device_driver = { } }; -static int __init tegra_nvec_init(void) -{ - return platform_driver_register(&nvec_device_driver); -} - -module_init(tegra_nvec_init); +module_platform_driver(nvec_device_driver); MODULE_ALIAS("platform:nvec"); MODULE_DESCRIPTION("NVIDIA compliant embedded controller interface"); diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c index a4ce5a740e2b..36ef6a6b01af 100644 --- a/drivers/staging/nvec/nvec_kbd.c +++ b/drivers/staging/nvec/nvec_kbd.c @@ -167,12 +167,7 @@ static struct platform_driver nvec_kbd_driver = { }, }; -static int __init nvec_kbd_init(void) -{ - return platform_driver_register(&nvec_kbd_driver); -} - -module_init(nvec_kbd_init); +module_platform_driver(nvec_kbd_driver); MODULE_AUTHOR("Marc Dietrich "); MODULE_DESCRIPTION("NVEC keyboard driver"); diff --git a/drivers/staging/nvec/nvec_leds.c b/drivers/staging/nvec/nvec_leds.c index 91947fb86067..53cb5711afa6 100644 --- a/drivers/staging/nvec/nvec_leds.c +++ b/drivers/staging/nvec/nvec_leds.c @@ -90,19 +90,7 @@ static struct platform_driver nvec_led_driver = { }, }; -static int __init nvec_led_init(void) -{ - return platform_driver_register(&nvec_led_driver); -} - -module_init(nvec_led_init); - -static void __exit nvec_led_exit(void) -{ - platform_driver_unregister(&nvec_led_driver); -} - -module_exit(nvec_led_exit); +module_platform_driver(nvec_led_driver); MODULE_AUTHOR("Ilya Petrov "); MODULE_DESCRIPTION("Tegra NVEC LED driver"); diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c index a23e5485c279..063f6d5e8ab1 100644 --- a/drivers/staging/nvec/nvec_power.c +++ b/drivers/staging/nvec/nvec_power.c @@ -415,12 +415,7 @@ static struct platform_driver nvec_power_driver = { } }; -static int __init nvec_power_init(void) -{ - return platform_driver_register(&nvec_power_driver); -} - -module_init(nvec_power_init); +module_platform_driver(nvec_power_driver); MODULE_AUTHOR("Ilya Petrov "); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c index d6ceff93d8b6..441dd76f10a1 100644 --- a/drivers/staging/nvec/nvec_ps2.c +++ b/drivers/staging/nvec/nvec_ps2.c @@ -158,12 +158,7 @@ static struct platform_driver nvec_mouse_driver = { }, }; -static int __init nvec_mouse_init(void) -{ - return platform_driver_register(&nvec_mouse_driver); -} - -module_init(nvec_mouse_init); +module_platform_driver(nvec_mouse_driver); MODULE_DESCRIPTION("NVEC mouse driver"); MODULE_AUTHOR("Marc Dietrich "); -- 2.20.1