]> Pileus Git - ~andy/linux/commitdiff
drivers: char: use module_platform_driver_probe()
authorFabio Porcedda <fabio.porcedda@gmail.com>
Thu, 14 Mar 2013 17:09:33 +0000 (18:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 19:24:20 +0000 (12:24 -0700)
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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/hw_random/mxc-rnga.c
drivers/char/hw_random/tx4939-rng.c

index f05d85713fd327a3c794deaea084c45e15fc9a1e..895d0b8fb9ab7eb5cc91abeadb22b38a00cdad7b 100644 (file)
@@ -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");
index 30991989d65b4e2fddb09da1b3faac330b155a06..d34a24a0d4841b89a8a9238090bcef4e9c88acae 100644 (file)
@@ -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");