mtd: omap2: Use module_platform_driver()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Apr 5 09:59:02 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=cdb6404cc53a166a1e3b0179bd8d1f4070beff41
Commit:     cdb6404cc53a166a1e3b0179bd8d1f4070beff41
Parent:     5884974eda0f7fa59d8a1a8e06169f0a2dba6bf3
Author:     Sachin Kamat <sachin.kamat at linaro.org>
AuthorDate: Mon Mar 18 16:46:50 2013 +0530
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Apr 5 14:05:32 2013 +0100

    mtd: omap2: Use module_platform_driver()
    
    module_platform_driver macro removes some boilerplate and makes the
    code simpler.
    
    Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/onenand/omap2.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index eec2aed..d98b198 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -832,19 +832,7 @@ static struct platform_driver omap2_onenand_driver = {
 	},
 };
 
-static int __init omap2_onenand_init(void)
-{
-	printk(KERN_INFO "OneNAND driver initializing\n");
-	return platform_driver_register(&omap2_onenand_driver);
-}
-
-static void __exit omap2_onenand_exit(void)
-{
-	platform_driver_unregister(&omap2_onenand_driver);
-}
-
-module_init(omap2_onenand_init);
-module_exit(omap2_onenand_exit);
+module_platform_driver(omap2_onenand_driver);
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 MODULE_LICENSE("GPL");



More information about the linux-mtd-cvs mailing list