mtd: convert drivers/mtd/* to use module_platform_driver()
authorAxel Lin <axel.lin@gmail.com>
Sun, 27 Nov 2011 12:45:03 +0000 (20:45 +0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 9 Jan 2012 18:12:35 +0000 (18:12 +0000)
This patch converts the drivers in drivers/mtd/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
29 files changed:
drivers/mtd/maps/bcm963xx-flash.c
drivers/mtd/maps/bfin-async-flash.c
drivers/mtd/maps/gpio-addr-flash.c
drivers/mtd/maps/ixp2000.c
drivers/mtd/maps/ixp4xx.c
drivers/mtd/maps/latch-addr-flash.c
drivers/mtd/maps/physmap_of.c
drivers/mtd/maps/pxa2xx-flash.c
drivers/mtd/maps/rbtx4939-flash.c
drivers/mtd/maps/sa1100-flash.c
drivers/mtd/maps/sun_uflash.c
drivers/mtd/nand/ams-delta.c
drivers/mtd/nand/bcm_umi_nand.c
drivers/mtd/nand/fsl_elbc_nand.c
drivers/mtd/nand/fsl_upm.c
drivers/mtd/nand/jz4740_nand.c
drivers/mtd/nand/mpc5121_nfc.c
drivers/mtd/nand/ndfc.c
drivers/mtd/nand/nomadik_nand.c
drivers/mtd/nand/nuc900_nand.c
drivers/mtd/nand/omap2.c
drivers/mtd/nand/pasemi_nand.c
drivers/mtd/nand/plat_nand.c
drivers/mtd/nand/pxa3xx_nand.c
drivers/mtd/nand/sharpsl.c
drivers/mtd/nand/socrates_nand.c
drivers/mtd/nand/tmio_nand.c
drivers/mtd/onenand/generic.c
drivers/mtd/onenand/samsung.c

index 736ca10ca9f11c0323d6062ef235f42a91f00727..56927f5302c10951e3ffa570770fcce31cc0cb57 100644 (file)
@@ -257,18 +257,7 @@ static struct platform_driver bcm63xx_mtd_dev = {
        },
 };
 
-static int __init bcm963xx_mtd_init(void)
-{
-       return platform_driver_register(&bcm63xx_mtd_dev);
-}
-
-static void __exit bcm963xx_mtd_exit(void)
-{
-       platform_driver_unregister(&bcm63xx_mtd_dev);
-}
-
-module_init(bcm963xx_mtd_init);
-module_exit(bcm963xx_mtd_exit);
+module_platform_driver(bcm63xx_mtd_dev);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Broadcom BCM63xx MTD driver for CFE and RedBoot");
index 6d6b2b5674ee6f4f27282e8356b301446a66c3eb..650126c361f18865d9e29b346fdeb8650208f9b6 100644 (file)
@@ -190,17 +190,7 @@ static struct platform_driver bfin_flash_driver = {
        },
 };
 
-static int __init bfin_flash_init(void)
-{
-       return platform_driver_register(&bfin_flash_driver);
-}
-module_init(bfin_flash_init);
-
-static void __exit bfin_flash_exit(void)
-{
-       platform_driver_unregister(&bfin_flash_driver);
-}
-module_exit(bfin_flash_exit);
+module_platform_driver(bfin_flash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("MTD map driver for Blackfins with flash/ethernet on same async bank");
index 1ec66f031c51655bb4904c985565f47fc2fc3bfe..33cce895859f0f8959cea03f06f28d24d9567b26 100644 (file)
@@ -279,17 +279,7 @@ static struct platform_driver gpio_flash_driver = {
        },
 };
 
-static int __init gpio_flash_init(void)
-{
-       return platform_driver_register(&gpio_flash_driver);
-}
-module_init(gpio_flash_init);
-
-static void __exit gpio_flash_exit(void)
-{
-       platform_driver_unregister(&gpio_flash_driver);
-}
-module_exit(gpio_flash_exit);
+module_platform_driver(gpio_flash_driver);
 
 MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>");
 MODULE_DESCRIPTION("MTD map driver for flashes addressed physically and with gpios");
index 437fcd2f352f8095b658cc4a9d1ef28cc01eddf5..fc7d4d0d9a4e4c31532577705f65209ffc1dbc7b 100644 (file)
@@ -246,18 +246,8 @@ static struct platform_driver ixp2000_flash_driver = {
        },
 };
 
-static int __init ixp2000_flash_init(void)
-{
-       return platform_driver_register(&ixp2000_flash_driver);
-}
-
-static void __exit ixp2000_flash_exit(void)
-{
-       platform_driver_unregister(&ixp2000_flash_driver);
-}
+module_platform_driver(ixp2000_flash_driver);
 
-module_init(ixp2000_flash_init);
-module_exit(ixp2000_flash_exit);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
 MODULE_ALIAS("platform:IXP2000-Flash");
index 30409015a3de1d67e9d37c2ce345b0a837a28006..8b5410162d70edecfa94277f361c9e5bf28c782a 100644 (file)
@@ -270,19 +270,7 @@ static struct platform_driver ixp4xx_flash_driver = {
        },
 };
 
-static int __init ixp4xx_flash_init(void)
-{
-       return platform_driver_register(&ixp4xx_flash_driver);
-}
-
-static void __exit ixp4xx_flash_exit(void)
-{
-       platform_driver_unregister(&ixp4xx_flash_driver);
-}
-
-
-module_init(ixp4xx_flash_init);
-module_exit(ixp4xx_flash_exit);
+module_platform_driver(ixp4xx_flash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems");
index 119baa7d74773088ea0f07ffd316b6ee2c807b7d..8fed58e3a4a808e9423f3e36b02eeb7e5b5276e2 100644 (file)
@@ -223,17 +223,7 @@ static struct platform_driver latch_addr_flash_driver = {
        },
 };
 
-static int __init latch_addr_flash_init(void)
-{
-       return platform_driver_register(&latch_addr_flash_driver);
-}
-module_init(latch_addr_flash_init);
-
-static void __exit latch_addr_flash_exit(void)
-{
-       platform_driver_unregister(&latch_addr_flash_driver);
-}
-module_exit(latch_addr_flash_exit);
+module_platform_driver(latch_addr_flash_driver);
 
 MODULE_AUTHOR("David Griego <dgriego@mvista.com>");
 MODULE_DESCRIPTION("MTD map driver for flashes addressed physically with upper "
index 7d65f9d3e6902e442003dfd7455953d1199c2d9a..2e6fb6831d553802400862b3ed0356e864405ab9 100644 (file)
@@ -338,18 +338,7 @@ static struct platform_driver of_flash_driver = {
        .remove         = of_flash_remove,
 };
 
-static int __init of_flash_init(void)
-{
-       return platform_driver_register(&of_flash_driver);
-}
-
-static void __exit of_flash_exit(void)
-{
-       platform_driver_unregister(&of_flash_driver);
-}
-
-module_init(of_flash_init);
-module_exit(of_flash_exit);
+module_platform_driver(of_flash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Vitaly Wool <vwool@ru.mvista.com>");
index 2a25b6789af4d5633ee7fcadf104fc08e9183928..274e39914332fa8fa2015e42d530f342032dbf3b 100644 (file)
@@ -142,18 +142,7 @@ static struct platform_driver pxa2xx_flash_driver = {
        .shutdown       = pxa2xx_flash_shutdown,
 };
 
-static int __init init_pxa2xx_flash(void)
-{
-       return platform_driver_register(&pxa2xx_flash_driver);
-}
-
-static void __exit cleanup_pxa2xx_flash(void)
-{
-       platform_driver_unregister(&pxa2xx_flash_driver);
-}
-
-module_init(init_pxa2xx_flash);
-module_exit(cleanup_pxa2xx_flash);
+module_platform_driver(pxa2xx_flash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Nicolas Pitre <nico@fluxnic.net>");
index 0237f197fd1238f553732f73a2db64ddba98c0f6..bb7d2042affa0dd238be64a02886d1e63c88801b 100644 (file)
@@ -137,18 +137,7 @@ static struct platform_driver rbtx4939_flash_driver = {
        },
 };
 
-static int __init rbtx4939_flash_init(void)
-{
-       return platform_driver_register(&rbtx4939_flash_driver);
-}
-
-static void __exit rbtx4939_flash_exit(void)
-{
-       platform_driver_unregister(&rbtx4939_flash_driver);
-}
-
-module_init(rbtx4939_flash_init);
-module_exit(rbtx4939_flash_exit);
+module_platform_driver(rbtx4939_flash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("RBTX4939 MTD map driver");
index fa9c0a9670cd88a4e050ba65f0d70f51fee9f3d7..ac3a290748cd431c72b96b7158bc0c358fafdbaa 100644 (file)
@@ -394,18 +394,7 @@ static struct platform_driver sa1100_mtd_driver = {
        },
 };
 
-static int __init sa1100_mtd_init(void)
-{
-       return platform_driver_register(&sa1100_mtd_driver);
-}
-
-static void __exit sa1100_mtd_exit(void)
-{
-       platform_driver_unregister(&sa1100_mtd_driver);
-}
-
-module_init(sa1100_mtd_init);
-module_exit(sa1100_mtd_exit);
+module_platform_driver(sa1100_mtd_driver);
 
 MODULE_AUTHOR("Nicolas Pitre");
 MODULE_DESCRIPTION("SA1100 CFI map driver");
index 2d66234f57cb471e3c9700b5fc35ad1e1c9b6e5f..175e537b444fc5d578412c47dbb5022f26382aec 100644 (file)
@@ -158,15 +158,4 @@ static struct platform_driver uflash_driver = {
        .remove         = __devexit_p(uflash_remove),
 };
 
-static int __init uflash_init(void)
-{
-       return platform_driver_register(&uflash_driver);
-}
-
-static void __exit uflash_exit(void)
-{
-       platform_driver_unregister(&uflash_driver);
-}
-
-module_init(uflash_init);
-module_exit(uflash_exit);
+module_platform_driver(uflash_driver);
index 9e6b498c9bebb07191d8146f447a89c56d2ca11b..3197e9764fcd32025c6ea715a05765ca4e45c30c 100644 (file)
@@ -280,17 +280,7 @@ static struct platform_driver ams_delta_nand_driver = {
        },
 };
 
-static int __init ams_delta_nand_init(void)
-{
-       return platform_driver_register(&ams_delta_nand_driver);
-}
-module_init(ams_delta_nand_init);
-
-static void __exit ams_delta_nand_exit(void)
-{
-       platform_driver_unregister(&ams_delta_nand_driver);
-}
-module_exit(ams_delta_nand_exit);
+module_platform_driver(ams_delta_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>");
index 46b58d67284726fe2cee86852f9fe4640679a8a6..50387fd4009bdbe464af98703e0653debf4baaf6 100644 (file)
@@ -546,18 +546,7 @@ static struct platform_driver nand_driver = {
        .resume = bcm_umi_nand_resume,
 };
 
-static int __init nand_init(void)
-{
-       return platform_driver_register(&nand_driver);
-}
-
-static void __exit nand_exit(void)
-{
-       platform_driver_unregister(&nand_driver);
-}
-
-module_init(nand_init);
-module_exit(nand_exit);
+module_platform_driver(nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Broadcom");
index eedd8ee2c9ac8b83059edf9cf5856a12e4a53e48..f2f6e874d4ded5b97833e422c39e1f73e22e4f19 100644 (file)
@@ -971,18 +971,7 @@ static struct platform_driver fsl_elbc_nand_driver = {
        .remove = fsl_elbc_nand_remove,
 };
 
-static int __init fsl_elbc_nand_init(void)
-{
-       return platform_driver_register(&fsl_elbc_nand_driver);
-}
-
-static void __exit fsl_elbc_nand_exit(void)
-{
-       platform_driver_unregister(&fsl_elbc_nand_driver);
-}
-
-module_init(fsl_elbc_nand_init);
-module_exit(fsl_elbc_nand_exit);
+module_platform_driver(fsl_elbc_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Freescale");
index b4f3cc9f32fbe5614ad8d1a0a1cbe905ee01d3f5..45df542b9c61383b3b183fdbcd318bf4eeffa92a 100644 (file)
@@ -353,17 +353,7 @@ static struct platform_driver of_fun_driver = {
        .remove         = __devexit_p(fun_remove),
 };
 
-static int __init fun_module_init(void)
-{
-       return platform_driver_register(&of_fun_driver);
-}
-module_init(fun_module_init);
-
-static void __exit fun_module_exit(void)
-{
-       platform_driver_unregister(&of_fun_driver);
-}
-module_exit(fun_module_exit);
+module_platform_driver(of_fun_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
index e2664073a89b8eae1afa5c2ef5fe3d81e0348722..ac3b9f255e009bd2696688c5d3673e60395be5d7 100644 (file)
@@ -423,17 +423,7 @@ static struct platform_driver jz_nand_driver = {
        },
 };
 
-static int __init jz_nand_init(void)
-{
-       return platform_driver_register(&jz_nand_driver);
-}
-module_init(jz_nand_init);
-
-static void __exit jz_nand_exit(void)
-{
-       platform_driver_unregister(&jz_nand_driver);
-}
-module_exit(jz_nand_exit);
+module_platform_driver(jz_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
index 5ede64706346084dd5cdd6d38612d532ec493992..c240cf1af96166f8c2431e029dc90064a443ecf4 100644 (file)
@@ -879,19 +879,7 @@ static struct platform_driver mpc5121_nfc_driver = {
        },
 };
 
-static int __init mpc5121_nfc_init(void)
-{
-       return platform_driver_register(&mpc5121_nfc_driver);
-}
-
-module_init(mpc5121_nfc_init);
-
-static void __exit mpc5121_nfc_cleanup(void)
-{
-       platform_driver_unregister(&mpc5121_nfc_driver);
-}
-
-module_exit(mpc5121_nfc_cleanup);
+module_platform_driver(mpc5121_nfc_driver);
 
 MODULE_AUTHOR("Freescale Semiconductor, Inc.");
 MODULE_DESCRIPTION("MPC5121 NAND MTD driver");
index f8aacf48ecddf6c12a63a10026e8b948d5f0a8e2..ec688548c880ef67d1cf568e6f568c678099232f 100644 (file)
@@ -294,18 +294,7 @@ static struct platform_driver ndfc_driver = {
        .remove = __devexit_p(ndfc_remove),
 };
 
-static int __init ndfc_nand_init(void)
-{
-       return platform_driver_register(&ndfc_driver);
-}
-
-static void __exit ndfc_nand_exit(void)
-{
-       platform_driver_unregister(&ndfc_driver);
-}
-
-module_init(ndfc_nand_init);
-module_exit(ndfc_nand_exit);
+module_platform_driver(ndfc_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
index b463ecfb4c1a248713073ab019efed1af2f3d538..673dc6c68f9ad396cd3a436bca8c042219b3de4b 100644 (file)
@@ -228,19 +228,7 @@ static struct platform_driver nomadik_nand_driver = {
        },
 };
 
-static int __init nand_nomadik_init(void)
-{
-       pr_info("Nomadik NAND driver\n");
-       return platform_driver_register(&nomadik_nand_driver);
-}
-
-static void __exit nand_nomadik_exit(void)
-{
-       platform_driver_unregister(&nomadik_nand_driver);
-}
-
-module_init(nand_nomadik_init);
-module_exit(nand_nomadik_exit);
+module_platform_driver(nomadik_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("ST Microelectronics (sachin.verma@st.com)");
index fa8faedfad6ee086d15bad4d249b3b0bd0874991..8febe46e1105e9aad7212dd442e4160d855fe11d 100644 (file)
@@ -364,18 +364,7 @@ static struct platform_driver nuc900_nand_driver = {
        },
 };
 
-static int __init nuc900_nand_init(void)
-{
-       return platform_driver_register(&nuc900_nand_driver);
-}
-
-static void __exit nuc900_nand_exit(void)
-{
-       platform_driver_unregister(&nuc900_nand_driver);
-}
-
-module_init(nuc900_nand_init);
-module_exit(nuc900_nand_exit);
+module_platform_driver(nuc900_nand_driver);
 
 MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
 MODULE_DESCRIPTION("w90p910/NUC9xx nand driver!");
index f745f00f3167d455f3d802a0b5ea9dc82a66b617..b3a883e2a22f63942f83e245304f2de82fcdf116 100644 (file)
@@ -1145,20 +1145,7 @@ static struct platform_driver omap_nand_driver = {
        },
 };
 
-static int __init omap_nand_init(void)
-{
-       pr_info("%s driver initializing\n", DRIVER_NAME);
-
-       return platform_driver_register(&omap_nand_driver);
-}
-
-static void __exit omap_nand_exit(void)
-{
-       platform_driver_unregister(&omap_nand_driver);
-}
-
-module_init(omap_nand_init);
-module_exit(omap_nand_exit);
+module_platform_driver(omap_nand_driver);
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 MODULE_LICENSE("GPL");
index a97264ececdbe2278edf20b11a2d072bd38feba4..974dbf8251c928842fe528c15777e4cd12efdaa8 100644 (file)
@@ -230,17 +230,7 @@ static struct platform_driver pasemi_nand_driver =
        .remove         = pasemi_nand_remove,
 };
 
-static int __init pasemi_nand_init(void)
-{
-       return platform_driver_register(&pasemi_nand_driver);
-}
-module_init(pasemi_nand_init);
-
-static void __exit pasemi_nand_exit(void)
-{
-       platform_driver_unregister(&pasemi_nand_driver);
-}
-module_exit(pasemi_nand_exit);
+module_platform_driver(pasemi_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
index ea8e1234e0e25895ed2a731ae1a0225d616468fa..7f2da6953357f80f06bfab9404d411db53f6ef05 100644 (file)
@@ -148,18 +148,7 @@ static struct platform_driver plat_nand_driver = {
        },
 };
 
-static int __init plat_nand_init(void)
-{
-       return platform_driver_register(&plat_nand_driver);
-}
-
-static void __exit plat_nand_exit(void)
-{
-       platform_driver_unregister(&plat_nand_driver);
-}
-
-module_init(plat_nand_init);
-module_exit(plat_nand_exit);
+module_platform_driver(plat_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Vitaly Wool");
index 9eb7f879969e31a2e5bd987bd27a5295f992516e..90d60169ae4064ce1b5635507bc2eba27944c314 100644 (file)
@@ -1311,17 +1311,7 @@ static struct platform_driver pxa3xx_nand_driver = {
        .resume         = pxa3xx_nand_resume,
 };
 
-static int __init pxa3xx_nand_init(void)
-{
-       return platform_driver_register(&pxa3xx_nand_driver);
-}
-module_init(pxa3xx_nand_init);
-
-static void __exit pxa3xx_nand_exit(void)
-{
-       platform_driver_unregister(&pxa3xx_nand_driver);
-}
-module_exit(pxa3xx_nand_exit);
+module_platform_driver(pxa3xx_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("PXA3xx NAND controller driver");
index 619d2a504788b050aa46cc48e0cd13c31588d921..b175c0fd8b9378009ecbcbf2ad6ad3cbf9b6f8a7 100644 (file)
@@ -230,17 +230,7 @@ static struct platform_driver sharpsl_nand_driver = {
        .remove         = __devexit_p(sharpsl_nand_remove),
 };
 
-static int __init sharpsl_nand_init(void)
-{
-       return platform_driver_register(&sharpsl_nand_driver);
-}
-module_init(sharpsl_nand_init);
-
-static void __exit sharpsl_nand_exit(void)
-{
-       platform_driver_unregister(&sharpsl_nand_driver);
-}
-module_exit(sharpsl_nand_exit);
+module_platform_driver(sharpsl_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
index 0fb24f9c232772dac3c307bff2c7eb7a2d690c5f..e02b08bcf0c044e7cd845b046f81d013ec8140cc 100644 (file)
@@ -273,18 +273,7 @@ static struct platform_driver socrates_nand_driver = {
        .remove         = __devexit_p(socrates_nand_remove),
 };
 
-static int __init socrates_nand_init(void)
-{
-       return platform_driver_register(&socrates_nand_driver);
-}
-
-static void __exit socrates_nand_exit(void)
-{
-       platform_driver_unregister(&socrates_nand_driver);
-}
-
-module_init(socrates_nand_init);
-module_exit(socrates_nand_exit);
+module_platform_driver(socrates_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Ilya Yanok");
index beebd95f76907de7e32102d0dd9a7593be99d0a7..6caa0cd9d6a7c23394d815516f321ae32ed97983 100644 (file)
@@ -533,18 +533,7 @@ static struct platform_driver tmio_driver = {
        .resume         = tmio_resume,
 };
 
-static int __init tmio_init(void)
-{
-       return platform_driver_register(&tmio_driver);
-}
-
-static void __exit tmio_exit(void)
-{
-       platform_driver_unregister(&tmio_driver);
-}
-
-module_init(tmio_init);
-module_exit(tmio_exit);
+module_platform_driver(tmio_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Ian Molton, Dirk Opfer, Chris Humbert, Dmitry Baryshkov");
index 7813095264a56192dbd13c0948da04cfdfd5f82f..0ccd5bff254459323827bd1f54b69d65b990c510 100644 (file)
@@ -115,21 +115,9 @@ static struct platform_driver generic_onenand_driver = {
        .remove         = __devexit_p(generic_onenand_remove),
 };
 
-MODULE_ALIAS("platform:" DRIVER_NAME);
-
-static int __init generic_onenand_init(void)
-{
-       return platform_driver_register(&generic_onenand_driver);
-}
-
-static void __exit generic_onenand_exit(void)
-{
-       platform_driver_unregister(&generic_onenand_driver);
-}
-
-module_init(generic_onenand_init);
-module_exit(generic_onenand_exit);
+module_platform_driver(generic_onenand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");
 MODULE_DESCRIPTION("Glue layer for OneNAND flash on generic boards");
+MODULE_ALIAS("platform:" DRIVER_NAME);
index 5474547eafc2fc271b2000bcf5c146a18b4a8372..fa1ee43f735b5bb8ec97d5c6861525f8c4b5757c 100644 (file)
@@ -1133,18 +1133,7 @@ static struct platform_driver s3c_onenand_driver = {
        .remove         = __devexit_p(s3c_onenand_remove),
 };
 
-static int __init s3c_onenand_init(void)
-{
-       return platform_driver_register(&s3c_onenand_driver);
-}
-
-static void __exit s3c_onenand_exit(void)
-{
-       platform_driver_unregister(&s3c_onenand_driver);
-}
-
-module_init(s3c_onenand_init);
-module_exit(s3c_onenand_exit);
+module_platform_driver(s3c_onenand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");