diff mbox

[v2,3/8] drivers: char: use module_platform_driver_probe()

Message ID 1363280978-24051-4-git-send-email-fabio.porcedda@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Fabio Porcedda March 14, 2013, 5:09 p.m. UTC
This patch converts the drivers to use the
module_platform_driver_probe() macro which makes the code smaller and
a bit simpler.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/char/hw_random/mxc-rnga.c   | 13 +------------
 drivers/char/hw_random/tx4939-rng.c | 13 +------------
 2 files changed, 2 insertions(+), 24 deletions(-)

Comments

Herbert Xu March 21, 2013, 9:55 a.m. UTC | #1
On Thu, Mar 14, 2013 at 06:09:33PM +0100, Fabio Porcedda wrote:
> This patch converts the drivers to use the
> module_platform_driver_probe() macro which makes the code smaller and
> a bit simpler.
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>

Patch applied.
Fabio Porcedda March 21, 2013, 10:15 a.m. UTC | #2
On Thu, Mar 21, 2013 at 10:55 AM, Herbert Xu
<herbert@gondor.apana.org.au> wrote:
> On Thu, Mar 14, 2013 at 06:09:33PM +0100, Fabio Porcedda wrote:
>> This patch converts the drivers to use the
>> module_platform_driver_probe() macro which makes the code smaller and
>> a bit simpler.
>>
>> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Matt Mackall <mpm@selenic.com>
>> Cc: Herbert Xu <herbert@gondor.apana.org.au>
>> Cc: Fabio Estevam <fabio.estevam@freescale.com>
>> Cc: Sascha Hauer <s.hauer@pengutronix.de>
>
> Patch applied.

The patch is already in
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git.
Are you speaking about that?

Best regards
--
Fabio Porcedda
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu March 21, 2013, 10:19 a.m. UTC | #3
On Thu, Mar 21, 2013 at 11:15:26AM +0100, Fabio Porcedda wrote:
> On Thu, Mar 21, 2013 at 10:55 AM, Herbert Xu
> <herbert@gondor.apana.org.au> wrote:
> > On Thu, Mar 14, 2013 at 06:09:33PM +0100, Fabio Porcedda wrote:
> >> This patch converts the drivers to use the
> >> module_platform_driver_probe() macro which makes the code smaller and
> >> a bit simpler.
> >>
> >> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Matt Mackall <mpm@selenic.com>
> >> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> >> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> >> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> >
> > Patch applied.
> 
> The patch is already in
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git.
> Are you speaking about that?

OK, I'll remove it from my tree.

Thanks,
diff mbox

Patch

diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c
index f05d857..895d0b8 100644
--- a/drivers/char/hw_random/mxc-rnga.c
+++ b/drivers/char/hw_random/mxc-rnga.c
@@ -228,18 +228,7 @@  static struct platform_driver mxc_rnga_driver = {
 	.remove = __exit_p(mxc_rnga_remove),
 };
 
-static int __init mod_init(void)
-{
-	return platform_driver_probe(&mxc_rnga_driver, mxc_rnga_probe);
-}
-
-static void __exit mod_exit(void)
-{
-	platform_driver_unregister(&mxc_rnga_driver);
-}
-
-module_init(mod_init);
-module_exit(mod_exit);
+module_platform_driver_probe(mxc_rnga_driver, mxc_rnga_probe);
 
 MODULE_AUTHOR("Freescale Semiconductor, Inc.");
 MODULE_DESCRIPTION("H/W RNGA driver for i.MX");
diff --git a/drivers/char/hw_random/tx4939-rng.c b/drivers/char/hw_random/tx4939-rng.c
index 3099198..d34a24a 100644
--- a/drivers/char/hw_random/tx4939-rng.c
+++ b/drivers/char/hw_random/tx4939-rng.c
@@ -166,18 +166,7 @@  static struct platform_driver tx4939_rng_driver = {
 	.remove = tx4939_rng_remove,
 };
 
-static int __init tx4939rng_init(void)
-{
-	return platform_driver_probe(&tx4939_rng_driver, tx4939_rng_probe);
-}
-
-static void __exit tx4939rng_exit(void)
-{
-	platform_driver_unregister(&tx4939_rng_driver);
-}
-
-module_init(tx4939rng_init);
-module_exit(tx4939rng_exit);
+module_platform_driver_probe(tx4939_rng_driver, tx4939_rng_probe);
 
 MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver for TX4939");
 MODULE_LICENSE("GPL");