hwrng: omap - Use module_platform_driver macro
authorLokesh Vutla <lokeshvutla@ti.com>
Mon, 5 Aug 2013 14:47:18 +0000 (20:17 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2013 06:39:46 +0000 (16:39 +1000)
module_platform_driver() makes the code simpler.
Using the macro in the driver.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/omap-rng.c

index 6843ec87b98b9f87b3a6ebc3736335d6884826ff..3e9a7ecbd5e59f35d321cd8f78742cf41f5b282a 100644 (file)
@@ -198,9 +198,6 @@ static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
 
 #endif
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:omap_rng");
-
 static struct platform_driver omap_rng_driver = {
        .driver = {
                .name           = "omap_rng",
@@ -211,18 +208,7 @@ static struct platform_driver omap_rng_driver = {
        .remove         = __exit_p(omap_rng_remove),
 };
 
-static int __init omap_rng_init(void)
-{
-       return platform_driver_register(&omap_rng_driver);
-}
-
-static void __exit omap_rng_exit(void)
-{
-       platform_driver_unregister(&omap_rng_driver);
-}
-
-module_init(omap_rng_init);
-module_exit(omap_rng_exit);
-
+module_platform_driver(omap_rng_driver);
+MODULE_ALIAS("platform:omap_rng");
 MODULE_AUTHOR("Deepak Saxena (and others)");
 MODULE_LICENSE("GPL");