[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322471704.2730.1.camel@phoenix>
Date: Mon, 28 Nov 2011 17:15:04 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel@...r.kernel.org
Cc: "John W. Linville" <linville@...driver.com>,
Johannes Berg <johannes@...solutions.net>,
"David S. Miller" <davem@...emloft.net>,
Antonio Ospite <ospite@...denti.unina.it>,
Rhyland Klein <rklein@...dia.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH] 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" <davem@...emloft.net>
Cc: "John W. Linville" <linville@...driver.com>
Cc: Johannes Berg <johannes@...solutions.net>
Cc: Antonio Ospite <ospite@...denti.unina.it>
Cc: Rhyland Klein <rklein@...dia.com>
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
net/rfkill/rfkill-gpio.c | 13 +------------
net/rfkill/rfkill-regulator.c | 12 +-----------
2 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 128677d..ca355e7 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -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");
diff --git a/net/rfkill/rfkill-regulator.c b/net/rfkill/rfkill-regulator.c
index 3ca7277..2ebfe8d 100644
--- a/net/rfkill/rfkill-regulator.c
+++ b/net/rfkill/rfkill-regulator.c
@@ -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 <gmzhuo@...il.com>");
MODULE_AUTHOR("Antonio Ospite <ospite@...denti.unina.it>");
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists