Skip to contentSkip to conversation

net: rfkill: convert net/rfkill/* to use module_platform_driver()

PATCH In review Axel Lin 2 participants 2 messages Nov 28, 2011

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 net: rfkill: convert net/rfkill/* to use module_platform_driver()

This patch converts the drivers in net/rfkill/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler.

Cc "David S. Miller" <[email protected]>
Cc "John W. Linville" <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Antonio Ospite <[email protected]>
Cc Rhyland Klein <[email protected]>
---
 net/rfkill/rfkill-gpio.c      |   13 +------------
 net/rfkill/rfkill-regulator.c |   12 +-----------
 2 files changed, 2 insertions(+), 23 deletions(-)
net/rfkill/rfkill-gpio.c +1 -12
index 128677d..ca355e7 100644
@@ -220,18 +220,7 @@ static struct platform_driver rfkill_gpio_driver = {
 	},
 };
 
-static int __init rfkill_gpio_init(void)
-{
-	return platform_driver_register(&rfkill_gpio_driver);
-}
-
-static void __exit rfkill_gpio_exit(void)
-{
-	platform_driver_unregister(&rfkill_gpio_driver);
-}
-
-module_init(rfkill_gpio_init);
-module_exit(rfkill_gpio_exit);
+module_platform_driver(rfkill_gpio_driver);
 
 MODULE_DESCRIPTION("gpio rfkill");
 MODULE_AUTHOR("NVIDIA");
net/rfkill/rfkill-regulator.c +1 -11
index 3ca7277..2ebfe8d 100644
@@ -144,17 +144,7 @@ static struct platform_driver rfkill_regulator_driver = {
 	},
 };
 
-static int __init rfkill_regulator_init(void)
-{
-	return platform_driver_register(&rfkill_regulator_driver);
-}
-module_init(rfkill_regulator_init);
-
-static void __exit rfkill_regulator_exit(void)
-{
-	platform_driver_unregister(&rfkill_regulator_driver);
-}
-module_exit(rfkill_regulator_exit);
+module_platform_driver(rfkill_regulator_driver);
 
 MODULE_AUTHOR("Guiming Zhuo <[email protected]>");
 MODULE_AUTHOR("Antonio Ospite <[email protected]>");
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · Axel Lin

This patch converts the drivers in net/rfkill/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler.

Cc "David S. Miller" <davem-fT/PcQaiUtIeIZ0/[email protected]>
Cc "John W. Linville" <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Antonio Ospite <[email protected]>
Cc Rhyland Klein <[email protected]>
---
 net/rfkill/rfkill-gpio.c      |   13 +------------
 net/rfkill/rfkill-regulator.c |   12 +-----------
 2 files changed, 2 insertions(+), 23 deletions(-)
net/rfkill/rfkill-gpio.c +0 -6
index 128677d..ca355e7 100644
@@ -220,18 +220,7 @@ static struct platform_driver rfkill_gpio_driver = {
 	},
 };
 
-static int __init rfkill_gpio_init(void)
-{
-	return platform_driver_register(&rfkill_gpio_driver);
-}
-
-static void __exit rfkill_gpio_exit(void)

net/rfkill/rfkill-gpio.c static struct platform_driver rfkill_gpio_driver = { · line 226

Quoted 10 lines
net/rfkill/rfkill-gpio.c +1 -6
-{
-	platform_driver_unregister(&rfkill_gpio_driver);
-}
-
-module_init(rfkill_gpio_init);
-module_exit(rfkill_gpio_exit);
+module_platform_driver(rfkill_gpio_driver);
 
 MODULE_DESCRIPTION("gpio rfkill");
 MODULE_AUTHOR("NVIDIA");

Gpio part looks good to me.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html