aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-11-27 07:45:03 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:12:35 -0500
commitf99640dee209df4730f35a28b02693affd571ad5 (patch)
treee09afc21f8fe3616af01bb23f5ae1b08b9290873 /drivers/mtd
parent1f9327fcffdac27e7b100b3a392291a7b94c97fd (diff)
mtd: convert drivers/mtd/* to use module_platform_driver()
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/bcm963xx-flash.c13
-rw-r--r--drivers/mtd/maps/bfin-async-flash.c12
-rw-r--r--drivers/mtd/maps/gpio-addr-flash.c12
-rw-r--r--drivers/mtd/maps/ixp2000.c12
-rw-r--r--drivers/mtd/maps/ixp4xx.c14
-rw-r--r--drivers/mtd/maps/latch-addr-flash.c12
-rw-r--r--drivers/mtd/maps/physmap_of.c13
-rw-r--r--drivers/mtd/maps/pxa2xx-flash.c13
-rw-r--r--drivers/mtd/maps/rbtx4939-flash.c13
-rw-r--r--drivers/mtd/maps/sa1100-flash.c13
-rw-r--r--drivers/mtd/maps/sun_uflash.c13
-rw-r--r--drivers/mtd/nand/ams-delta.c12
-rw-r--r--drivers/mtd/nand/bcm_umi_nand.c13
-rw-r--r--drivers/mtd/nand/fsl_elbc_nand.c13
-rw-r--r--drivers/mtd/nand/fsl_upm.c12
-rw-r--r--drivers/mtd/nand/jz4740_nand.c12
-rw-r--r--drivers/mtd/nand/mpc5121_nfc.c14
-rw-r--r--drivers/mtd/nand/ndfc.c13
-rw-r--r--drivers/mtd/nand/nomadik_nand.c14
-rw-r--r--drivers/mtd/nand/nuc900_nand.c13
-rw-r--r--drivers/mtd/nand/omap2.c15
-rw-r--r--drivers/mtd/nand/pasemi_nand.c12
-rw-r--r--drivers/mtd/nand/plat_nand.c13
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c12
-rw-r--r--drivers/mtd/nand/sharpsl.c12
-rw-r--r--drivers/mtd/nand/socrates_nand.c13
-rw-r--r--drivers/mtd/nand/tmio_nand.c13
-rw-r--r--drivers/mtd/onenand/generic.c16
-rw-r--r--drivers/mtd/onenand/samsung.c13
29 files changed, 30 insertions, 345 deletions
diff --git a/drivers/mtd/maps/bcm963xx-flash.c b/drivers/mtd/maps/bcm963xx-flash.c
index 736ca10ca9f1..56927f5302c1 100644
--- a/drivers/mtd/maps/bcm963xx-flash.c
+++ b/drivers/mtd/maps/bcm963xx-flash.c
@@ -257,18 +257,7 @@ static struct platform_driver bcm63xx_mtd_dev = {
257 }, 257 },
258}; 258};
259 259
260static int __init bcm963xx_mtd_init(void) 260module_platform_driver(bcm63xx_mtd_dev);
261{
262 return platform_driver_register(&bcm63xx_mtd_dev);
263}
264
265static void __exit bcm963xx_mtd_exit(void)
266{
267 platform_driver_unregister(&bcm63xx_mtd_dev);
268}
269
270module_init(bcm963xx_mtd_init);
271module_exit(bcm963xx_mtd_exit);
272 261
273MODULE_LICENSE("GPL"); 262MODULE_LICENSE("GPL");
274MODULE_DESCRIPTION("Broadcom BCM63xx MTD driver for CFE and RedBoot"); 263MODULE_DESCRIPTION("Broadcom BCM63xx MTD driver for CFE and RedBoot");
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c
index 6d6b2b5674ee..650126c361f1 100644
--- a/drivers/mtd/maps/bfin-async-flash.c
+++ b/drivers/mtd/maps/bfin-async-flash.c
@@ -190,17 +190,7 @@ static struct platform_driver bfin_flash_driver = {
190 }, 190 },
191}; 191};
192 192
193static int __init bfin_flash_init(void) 193module_platform_driver(bfin_flash_driver);
194{
195 return platform_driver_register(&bfin_flash_driver);
196}
197module_init(bfin_flash_init);
198
199static void __exit bfin_flash_exit(void)
200{
201 platform_driver_unregister(&bfin_flash_driver);
202}
203module_exit(bfin_flash_exit);
204 194
205MODULE_LICENSE("GPL"); 195MODULE_LICENSE("GPL");
206MODULE_DESCRIPTION("MTD map driver for Blackfins with flash/ethernet on same async bank"); 196MODULE_DESCRIPTION("MTD map driver for Blackfins with flash/ethernet on same async bank");
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
index 1ec66f031c51..33cce895859f 100644
--- a/drivers/mtd/maps/gpio-addr-flash.c
+++ b/drivers/mtd/maps/gpio-addr-flash.c
@@ -279,17 +279,7 @@ static struct platform_driver gpio_flash_driver = {
279 }, 279 },
280}; 280};
281 281
282static int __init gpio_flash_init(void) 282module_platform_driver(gpio_flash_driver);
283{
284 return platform_driver_register(&gpio_flash_driver);
285}
286module_init(gpio_flash_init);
287
288static void __exit gpio_flash_exit(void)
289{
290 platform_driver_unregister(&gpio_flash_driver);
291}
292module_exit(gpio_flash_exit);
293 283
294MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>"); 284MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>");
295MODULE_DESCRIPTION("MTD map driver for flashes addressed physically and with gpios"); 285MODULE_DESCRIPTION("MTD map driver for flashes addressed physically and with gpios");
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c
index 437fcd2f352f..fc7d4d0d9a4e 100644
--- a/drivers/mtd/maps/ixp2000.c
+++ b/drivers/mtd/maps/ixp2000.c
@@ -246,18 +246,8 @@ static struct platform_driver ixp2000_flash_driver = {
246 }, 246 },
247}; 247};
248 248
249static int __init ixp2000_flash_init(void) 249module_platform_driver(ixp2000_flash_driver);
250{
251 return platform_driver_register(&ixp2000_flash_driver);
252}
253
254static void __exit ixp2000_flash_exit(void)
255{
256 platform_driver_unregister(&ixp2000_flash_driver);
257}
258 250
259module_init(ixp2000_flash_init);
260module_exit(ixp2000_flash_exit);
261MODULE_LICENSE("GPL"); 251MODULE_LICENSE("GPL");
262MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>"); 252MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
263MODULE_ALIAS("platform:IXP2000-Flash"); 253MODULE_ALIAS("platform:IXP2000-Flash");
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index 30409015a3de..8b5410162d70 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -270,19 +270,7 @@ static struct platform_driver ixp4xx_flash_driver = {
270 }, 270 },
271}; 271};
272 272
273static int __init ixp4xx_flash_init(void) 273module_platform_driver(ixp4xx_flash_driver);
274{
275 return platform_driver_register(&ixp4xx_flash_driver);
276}
277
278static void __exit ixp4xx_flash_exit(void)
279{
280 platform_driver_unregister(&ixp4xx_flash_driver);
281}
282
283
284module_init(ixp4xx_flash_init);
285module_exit(ixp4xx_flash_exit);
286 274
287MODULE_LICENSE("GPL"); 275MODULE_LICENSE("GPL");
288MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems"); 276MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems");
diff --git a/drivers/mtd/maps/latch-addr-flash.c b/drivers/mtd/maps/latch-addr-flash.c
index 119baa7d7477..8fed58e3a4a8 100644
--- a/drivers/mtd/maps/latch-addr-flash.c
+++ b/drivers/mtd/maps/latch-addr-flash.c
@@ -223,17 +223,7 @@ static struct platform_driver latch_addr_flash_driver = {
223 }, 223 },
224}; 224};
225 225
226static int __init latch_addr_flash_init(void) 226module_platform_driver(latch_addr_flash_driver);
227{
228 return platform_driver_register(&latch_addr_flash_driver);
229}
230module_init(latch_addr_flash_init);
231
232static void __exit latch_addr_flash_exit(void)
233{
234 platform_driver_unregister(&latch_addr_flash_driver);
235}
236module_exit(latch_addr_flash_exit);
237 227
238MODULE_AUTHOR("David Griego <dgriego@mvista.com>"); 228MODULE_AUTHOR("David Griego <dgriego@mvista.com>");
239MODULE_DESCRIPTION("MTD map driver for flashes addressed physically with upper " 229MODULE_DESCRIPTION("MTD map driver for flashes addressed physically with upper "
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 7d65f9d3e690..2e6fb6831d55 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -338,18 +338,7 @@ static struct platform_driver of_flash_driver = {
338 .remove = of_flash_remove, 338 .remove = of_flash_remove,
339}; 339};
340 340
341static int __init of_flash_init(void) 341module_platform_driver(of_flash_driver);
342{
343 return platform_driver_register(&of_flash_driver);
344}
345
346static void __exit of_flash_exit(void)
347{
348 platform_driver_unregister(&of_flash_driver);
349}
350
351module_init(of_flash_init);
352module_exit(of_flash_exit);
353 342
354MODULE_LICENSE("GPL"); 343MODULE_LICENSE("GPL");
355MODULE_AUTHOR("Vitaly Wool <vwool@ru.mvista.com>"); 344MODULE_AUTHOR("Vitaly Wool <vwool@ru.mvista.com>");
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 2a25b6789af4..274e39914332 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -142,18 +142,7 @@ static struct platform_driver pxa2xx_flash_driver = {
142 .shutdown = pxa2xx_flash_shutdown, 142 .shutdown = pxa2xx_flash_shutdown,
143}; 143};
144 144
145static int __init init_pxa2xx_flash(void) 145module_platform_driver(pxa2xx_flash_driver);
146{
147 return platform_driver_register(&pxa2xx_flash_driver);
148}
149
150static void __exit cleanup_pxa2xx_flash(void)
151{
152 platform_driver_unregister(&pxa2xx_flash_driver);
153}
154
155module_init(init_pxa2xx_flash);
156module_exit(cleanup_pxa2xx_flash);
157 146
158MODULE_LICENSE("GPL"); 147MODULE_LICENSE("GPL");
159MODULE_AUTHOR("Nicolas Pitre <nico@fluxnic.net>"); 148MODULE_AUTHOR("Nicolas Pitre <nico@fluxnic.net>");
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 0237f197fd12..bb7d2042affa 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -137,18 +137,7 @@ static struct platform_driver rbtx4939_flash_driver = {
137 }, 137 },
138}; 138};
139 139
140static int __init rbtx4939_flash_init(void) 140module_platform_driver(rbtx4939_flash_driver);
141{
142 return platform_driver_register(&rbtx4939_flash_driver);
143}
144
145static void __exit rbtx4939_flash_exit(void)
146{
147 platform_driver_unregister(&rbtx4939_flash_driver);
148}
149
150module_init(rbtx4939_flash_init);
151module_exit(rbtx4939_flash_exit);
152 141
153MODULE_LICENSE("GPL"); 142MODULE_LICENSE("GPL");
154MODULE_DESCRIPTION("RBTX4939 MTD map driver"); 143MODULE_DESCRIPTION("RBTX4939 MTD map driver");
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index fa9c0a9670cd..ac3a290748cd 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -394,18 +394,7 @@ static struct platform_driver sa1100_mtd_driver = {
394 }, 394 },
395}; 395};
396 396
397static int __init sa1100_mtd_init(void) 397module_platform_driver(sa1100_mtd_driver);
398{
399 return platform_driver_register(&sa1100_mtd_driver);
400}
401
402static void __exit sa1100_mtd_exit(void)
403{
404 platform_driver_unregister(&sa1100_mtd_driver);
405}
406
407module_init(sa1100_mtd_init);
408module_exit(sa1100_mtd_exit);
409 398
410MODULE_AUTHOR("Nicolas Pitre"); 399MODULE_AUTHOR("Nicolas Pitre");
411MODULE_DESCRIPTION("SA1100 CFI map driver"); 400MODULE_DESCRIPTION("SA1100 CFI map driver");
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index 2d66234f57cb..175e537b444f 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -158,15 +158,4 @@ static struct platform_driver uflash_driver = {
158 .remove = __devexit_p(uflash_remove), 158 .remove = __devexit_p(uflash_remove),
159}; 159};
160 160
161static int __init uflash_init(void) 161module_platform_driver(uflash_driver);
162{
163 return platform_driver_register(&uflash_driver);
164}
165
166static void __exit uflash_exit(void)
167{
168 platform_driver_unregister(&uflash_driver);
169}
170
171module_init(uflash_init);
172module_exit(uflash_exit);
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 9e6b498c9beb..3197e9764fcd 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -280,17 +280,7 @@ static struct platform_driver ams_delta_nand_driver = {
280 }, 280 },
281}; 281};
282 282
283static int __init ams_delta_nand_init(void) 283module_platform_driver(ams_delta_nand_driver);
284{
285 return platform_driver_register(&ams_delta_nand_driver);
286}
287module_init(ams_delta_nand_init);
288
289static void __exit ams_delta_nand_exit(void)
290{
291 platform_driver_unregister(&ams_delta_nand_driver);
292}
293module_exit(ams_delta_nand_exit);
294 284
295MODULE_LICENSE("GPL"); 285MODULE_LICENSE("GPL");
296MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>"); 286MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>");
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index 46b58d672847..50387fd4009b 100644
--- a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -546,18 +546,7 @@ static struct platform_driver nand_driver = {
546 .resume = bcm_umi_nand_resume, 546 .resume = bcm_umi_nand_resume,
547}; 547};
548 548
549static int __init nand_init(void) 549module_platform_driver(nand_driver);
550{
551 return platform_driver_register(&nand_driver);
552}
553
554static void __exit nand_exit(void)
555{
556 platform_driver_unregister(&nand_driver);
557}
558
559module_init(nand_init);
560module_exit(nand_exit);
561 550
562MODULE_LICENSE("GPL"); 551MODULE_LICENSE("GPL");
563MODULE_AUTHOR("Broadcom"); 552MODULE_AUTHOR("Broadcom");
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index eedd8ee2c9ac..f2f6e874d4de 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -971,18 +971,7 @@ static struct platform_driver fsl_elbc_nand_driver = {
971 .remove = fsl_elbc_nand_remove, 971 .remove = fsl_elbc_nand_remove,
972}; 972};
973 973
974static int __init fsl_elbc_nand_init(void) 974module_platform_driver(fsl_elbc_nand_driver);
975{
976 return platform_driver_register(&fsl_elbc_nand_driver);
977}
978
979static void __exit fsl_elbc_nand_exit(void)
980{
981 platform_driver_unregister(&fsl_elbc_nand_driver);
982}
983
984module_init(fsl_elbc_nand_init);
985module_exit(fsl_elbc_nand_exit);
986 975
987MODULE_LICENSE("GPL"); 976MODULE_LICENSE("GPL");
988MODULE_AUTHOR("Freescale"); 977MODULE_AUTHOR("Freescale");
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index b4f3cc9f32fb..45df542b9c61 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -353,17 +353,7 @@ static struct platform_driver of_fun_driver = {
353 .remove = __devexit_p(fun_remove), 353 .remove = __devexit_p(fun_remove),
354}; 354};
355 355
356static int __init fun_module_init(void) 356module_platform_driver(of_fun_driver);
357{
358 return platform_driver_register(&of_fun_driver);
359}
360module_init(fun_module_init);
361
362static void __exit fun_module_exit(void)
363{
364 platform_driver_unregister(&of_fun_driver);
365}
366module_exit(fun_module_exit);
367 357
368MODULE_LICENSE("GPL"); 358MODULE_LICENSE("GPL");
369MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>"); 359MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index e2664073a89b..ac3b9f255e00 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -423,17 +423,7 @@ static struct platform_driver jz_nand_driver = {
423 }, 423 },
424}; 424};
425 425
426static int __init jz_nand_init(void) 426module_platform_driver(jz_nand_driver);
427{
428 return platform_driver_register(&jz_nand_driver);
429}
430module_init(jz_nand_init);
431
432static void __exit jz_nand_exit(void)
433{
434 platform_driver_unregister(&jz_nand_driver);
435}
436module_exit(jz_nand_exit);
437 427
438MODULE_LICENSE("GPL"); 428MODULE_LICENSE("GPL");
439MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); 429MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 5ede64706346..c240cf1af961 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -879,19 +879,7 @@ static struct platform_driver mpc5121_nfc_driver = {
879 }, 879 },
880}; 880};
881 881
882static int __init mpc5121_nfc_init(void) 882module_platform_driver(mpc5121_nfc_driver);
883{
884 return platform_driver_register(&mpc5121_nfc_driver);
885}
886
887module_init(mpc5121_nfc_init);
888
889static void __exit mpc5121_nfc_cleanup(void)
890{
891 platform_driver_unregister(&mpc5121_nfc_driver);
892}
893
894module_exit(mpc5121_nfc_cleanup);
895 883
896MODULE_AUTHOR("Freescale Semiconductor, Inc."); 884MODULE_AUTHOR("Freescale Semiconductor, Inc.");
897MODULE_DESCRIPTION("MPC5121 NAND MTD driver"); 885MODULE_DESCRIPTION("MPC5121 NAND MTD driver");
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index f8aacf48ecdd..ec688548c880 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -294,18 +294,7 @@ static struct platform_driver ndfc_driver = {
294 .remove = __devexit_p(ndfc_remove), 294 .remove = __devexit_p(ndfc_remove),
295}; 295};
296 296
297static int __init ndfc_nand_init(void) 297module_platform_driver(ndfc_driver);
298{
299 return platform_driver_register(&ndfc_driver);
300}
301
302static void __exit ndfc_nand_exit(void)
303{
304 platform_driver_unregister(&ndfc_driver);
305}
306
307module_init(ndfc_nand_init);
308module_exit(ndfc_nand_exit);
309 298
310MODULE_LICENSE("GPL"); 299MODULE_LICENSE("GPL");
311MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>"); 300MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index b463ecfb4c1a..673dc6c68f9a 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -228,19 +228,7 @@ static struct platform_driver nomadik_nand_driver = {
228 }, 228 },
229}; 229};
230 230
231static int __init nand_nomadik_init(void) 231module_platform_driver(nomadik_nand_driver);
232{
233 pr_info("Nomadik NAND driver\n");
234 return platform_driver_register(&nomadik_nand_driver);
235}
236
237static void __exit nand_nomadik_exit(void)
238{
239 platform_driver_unregister(&nomadik_nand_driver);
240}
241
242module_init(nand_nomadik_init);
243module_exit(nand_nomadik_exit);
244 232
245MODULE_LICENSE("GPL"); 233MODULE_LICENSE("GPL");
246MODULE_AUTHOR("ST Microelectronics (sachin.verma@st.com)"); 234MODULE_AUTHOR("ST Microelectronics (sachin.verma@st.com)");
diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand/nuc900_nand.c
index fa8faedfad6e..8febe46e1105 100644
--- a/drivers/mtd/nand/nuc900_nand.c
+++ b/drivers/mtd/nand/nuc900_nand.c
@@ -364,18 +364,7 @@ static struct platform_driver nuc900_nand_driver = {
364 }, 364 },
365}; 365};
366 366
367static int __init nuc900_nand_init(void) 367module_platform_driver(nuc900_nand_driver);
368{
369 return platform_driver_register(&nuc900_nand_driver);
370}
371
372static void __exit nuc900_nand_exit(void)
373{
374 platform_driver_unregister(&nuc900_nand_driver);
375}
376
377module_init(nuc900_nand_init);
378module_exit(nuc900_nand_exit);
379 368
380MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); 369MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
381MODULE_DESCRIPTION("w90p910/NUC9xx nand driver!"); 370MODULE_DESCRIPTION("w90p910/NUC9xx nand driver!");
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index f745f00f3167..b3a883e2a22f 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1145,20 +1145,7 @@ static struct platform_driver omap_nand_driver = {
1145 }, 1145 },
1146}; 1146};
1147 1147
1148static int __init omap_nand_init(void) 1148module_platform_driver(omap_nand_driver);
1149{
1150 pr_info("%s driver initializing\n", DRIVER_NAME);
1151
1152 return platform_driver_register(&omap_nand_driver);
1153}
1154
1155static void __exit omap_nand_exit(void)
1156{
1157 platform_driver_unregister(&omap_nand_driver);
1158}
1159
1160module_init(omap_nand_init);
1161module_exit(omap_nand_exit);
1162 1149
1163MODULE_ALIAS("platform:" DRIVER_NAME); 1150MODULE_ALIAS("platform:" DRIVER_NAME);
1164MODULE_LICENSE("GPL"); 1151MODULE_LICENSE("GPL");
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index a97264ececdb..974dbf8251c9 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -230,17 +230,7 @@ static struct platform_driver pasemi_nand_driver =
230 .remove = pasemi_nand_remove, 230 .remove = pasemi_nand_remove,
231}; 231};
232 232
233static int __init pasemi_nand_init(void) 233module_platform_driver(pasemi_nand_driver);
234{
235 return platform_driver_register(&pasemi_nand_driver);
236}
237module_init(pasemi_nand_init);
238
239static void __exit pasemi_nand_exit(void)
240{
241 platform_driver_unregister(&pasemi_nand_driver);
242}
243module_exit(pasemi_nand_exit);
244 234
245MODULE_LICENSE("GPL"); 235MODULE_LICENSE("GPL");
246MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>"); 236MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index ea8e1234e0e2..7f2da6953357 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -148,18 +148,7 @@ static struct platform_driver plat_nand_driver = {
148 }, 148 },
149}; 149};
150 150
151static int __init plat_nand_init(void) 151module_platform_driver(plat_nand_driver);
152{
153 return platform_driver_register(&plat_nand_driver);
154}
155
156static void __exit plat_nand_exit(void)
157{
158 platform_driver_unregister(&plat_nand_driver);
159}
160
161module_init(plat_nand_init);
162module_exit(plat_nand_exit);
163 152
164MODULE_LICENSE("GPL"); 153MODULE_LICENSE("GPL");
165MODULE_AUTHOR("Vitaly Wool"); 154MODULE_AUTHOR("Vitaly Wool");
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 9eb7f879969e..90d60169ae40 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1311,17 +1311,7 @@ static struct platform_driver pxa3xx_nand_driver = {
1311 .resume = pxa3xx_nand_resume, 1311 .resume = pxa3xx_nand_resume,
1312}; 1312};
1313 1313
1314static int __init pxa3xx_nand_init(void) 1314module_platform_driver(pxa3xx_nand_driver);
1315{
1316 return platform_driver_register(&pxa3xx_nand_driver);
1317}
1318module_init(pxa3xx_nand_init);
1319
1320static void __exit pxa3xx_nand_exit(void)
1321{
1322 platform_driver_unregister(&pxa3xx_nand_driver);
1323}
1324module_exit(pxa3xx_nand_exit);
1325 1315
1326MODULE_LICENSE("GPL"); 1316MODULE_LICENSE("GPL");
1327MODULE_DESCRIPTION("PXA3xx NAND controller driver"); 1317MODULE_DESCRIPTION("PXA3xx NAND controller driver");
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c
index 619d2a504788..b175c0fd8b93 100644
--- a/drivers/mtd/nand/sharpsl.c
+++ b/drivers/mtd/nand/sharpsl.c
@@ -230,17 +230,7 @@ static struct platform_driver sharpsl_nand_driver = {
230 .remove = __devexit_p(sharpsl_nand_remove), 230 .remove = __devexit_p(sharpsl_nand_remove),
231}; 231};
232 232
233static int __init sharpsl_nand_init(void) 233module_platform_driver(sharpsl_nand_driver);
234{
235 return platform_driver_register(&sharpsl_nand_driver);
236}
237module_init(sharpsl_nand_init);
238
239static void __exit sharpsl_nand_exit(void)
240{
241 platform_driver_unregister(&sharpsl_nand_driver);
242}
243module_exit(sharpsl_nand_exit);
244 234
245MODULE_LICENSE("GPL"); 235MODULE_LICENSE("GPL");
246MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>"); 236MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c
index 0fb24f9c2327..e02b08bcf0c0 100644
--- a/drivers/mtd/nand/socrates_nand.c
+++ b/drivers/mtd/nand/socrates_nand.c
@@ -273,18 +273,7 @@ static struct platform_driver socrates_nand_driver = {
273 .remove = __devexit_p(socrates_nand_remove), 273 .remove = __devexit_p(socrates_nand_remove),
274}; 274};
275 275
276static int __init socrates_nand_init(void) 276module_platform_driver(socrates_nand_driver);
277{
278 return platform_driver_register(&socrates_nand_driver);
279}
280
281static void __exit socrates_nand_exit(void)
282{
283 platform_driver_unregister(&socrates_nand_driver);
284}
285
286module_init(socrates_nand_init);
287module_exit(socrates_nand_exit);
288 277
289MODULE_LICENSE("GPL"); 278MODULE_LICENSE("GPL");
290MODULE_AUTHOR("Ilya Yanok"); 279MODULE_AUTHOR("Ilya Yanok");
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index beebd95f7690..6caa0cd9d6a7 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -533,18 +533,7 @@ static struct platform_driver tmio_driver = {
533 .resume = tmio_resume, 533 .resume = tmio_resume,
534}; 534};
535 535
536static int __init tmio_init(void) 536module_platform_driver(tmio_driver);
537{
538 return platform_driver_register(&tmio_driver);
539}
540
541static void __exit tmio_exit(void)
542{
543 platform_driver_unregister(&tmio_driver);
544}
545
546module_init(tmio_init);
547module_exit(tmio_exit);
548 537
549MODULE_LICENSE("GPL v2"); 538MODULE_LICENSE("GPL v2");
550MODULE_AUTHOR("Ian Molton, Dirk Opfer, Chris Humbert, Dmitry Baryshkov"); 539MODULE_AUTHOR("Ian Molton, Dirk Opfer, Chris Humbert, Dmitry Baryshkov");
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
index 7813095264a5..0ccd5bff2544 100644
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@ -115,21 +115,9 @@ static struct platform_driver generic_onenand_driver = {
115 .remove = __devexit_p(generic_onenand_remove), 115 .remove = __devexit_p(generic_onenand_remove),
116}; 116};
117 117
118MODULE_ALIAS("platform:" DRIVER_NAME); 118module_platform_driver(generic_onenand_driver);
119
120static int __init generic_onenand_init(void)
121{
122 return platform_driver_register(&generic_onenand_driver);
123}
124
125static void __exit generic_onenand_exit(void)
126{
127 platform_driver_unregister(&generic_onenand_driver);
128}
129
130module_init(generic_onenand_init);
131module_exit(generic_onenand_exit);
132 119
133MODULE_LICENSE("GPL"); 120MODULE_LICENSE("GPL");
134MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>"); 121MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");
135MODULE_DESCRIPTION("Glue layer for OneNAND flash on generic boards"); 122MODULE_DESCRIPTION("Glue layer for OneNAND flash on generic boards");
123MODULE_ALIAS("platform:" DRIVER_NAME);
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index 5474547eafc2..fa1ee43f735b 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -1133,18 +1133,7 @@ static struct platform_driver s3c_onenand_driver = {
1133 .remove = __devexit_p(s3c_onenand_remove), 1133 .remove = __devexit_p(s3c_onenand_remove),
1134}; 1134};
1135 1135
1136static int __init s3c_onenand_init(void) 1136module_platform_driver(s3c_onenand_driver);
1137{
1138 return platform_driver_register(&s3c_onenand_driver);
1139}
1140
1141static void __exit s3c_onenand_exit(void)
1142{
1143 platform_driver_unregister(&s3c_onenand_driver);
1144}
1145
1146module_init(s3c_onenand_init);
1147module_exit(s3c_onenand_exit);
1148 1137
1149MODULE_LICENSE("GPL"); 1138MODULE_LICENSE("GPL");
1150MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>"); 1139MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");