* [PATCH] net: rfkill: convert net/rfkill/* to use module_platform_driver()
@ 2011-11-28 9:15 Axel Lin
2011-11-28 19:09 ` Rhyland Klein
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2011-11-28 9:15 UTC (permalink / raw)
To: linux-kernel
Cc: John W. Linville, Johannes Berg, David S. Miller, Antonio Ospite,
Rhyland Klein, linux-wireless, netdev
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@davemloft.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Antonio Ospite <ospite@studenti.unina.it>
Cc: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Axel Lin <axel.lin@gmail.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@gmail.com>");
MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>");
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: rfkill: convert net/rfkill/* to use module_platform_driver()
2011-11-28 9:15 [PATCH] net: rfkill: convert net/rfkill/* to use module_platform_driver() Axel Lin
@ 2011-11-28 19:09 ` Rhyland Klein
0 siblings, 0 replies; 2+ messages in thread
From: Rhyland Klein @ 2011-11-28 19:09 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, John W. Linville, Johannes Berg, David S. Miller,
Antonio Ospite, linux-wireless, netdev
On Mon, 2011-11-28 at 01:15 -0800, Axel Lin wrote:
> 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@davemloft.net>
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: Antonio Ospite <ospite@studenti.unina.it>
> Cc: Rhyland Klein <rklein@nvidia.com>
> Signed-off-by: Axel Lin <axel.lin@gmail.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");
Gpio part looks good to me.
Acked-by: Rhyland Klein <rklein@nvidia.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-28 19:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28 9:15 [PATCH] net: rfkill: convert net/rfkill/* to use module_platform_driver() Axel Lin
2011-11-28 19:09 ` Rhyland Klein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).