diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-27 07:45:03 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:12:35 -0500 |
commit | f99640dee209df4730f35a28b02693affd571ad5 (patch) | |
tree | e09afc21f8fe3616af01bb23f5ae1b08b9290873 /drivers/mtd/maps | |
parent | 1f9327fcffdac27e7b100b3a392291a7b94c97fd (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/maps')
-rw-r--r-- | drivers/mtd/maps/bcm963xx-flash.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/bfin-async-flash.c | 12 | ||||
-rw-r--r-- | drivers/mtd/maps/gpio-addr-flash.c | 12 | ||||
-rw-r--r-- | drivers/mtd/maps/ixp2000.c | 12 | ||||
-rw-r--r-- | drivers/mtd/maps/ixp4xx.c | 14 | ||||
-rw-r--r-- | drivers/mtd/maps/latch-addr-flash.c | 12 | ||||
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/rbtx4939-flash.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/sa1100-flash.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/sun_uflash.c | 13 |
11 files changed, 11 insertions, 129 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 | ||
260 | static int __init bcm963xx_mtd_init(void) | 260 | module_platform_driver(bcm63xx_mtd_dev); |
261 | { | ||
262 | return platform_driver_register(&bcm63xx_mtd_dev); | ||
263 | } | ||
264 | |||
265 | static void __exit bcm963xx_mtd_exit(void) | ||
266 | { | ||
267 | platform_driver_unregister(&bcm63xx_mtd_dev); | ||
268 | } | ||
269 | |||
270 | module_init(bcm963xx_mtd_init); | ||
271 | module_exit(bcm963xx_mtd_exit); | ||
272 | 261 | ||
273 | MODULE_LICENSE("GPL"); | 262 | MODULE_LICENSE("GPL"); |
274 | MODULE_DESCRIPTION("Broadcom BCM63xx MTD driver for CFE and RedBoot"); | 263 | MODULE_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 | ||
193 | static int __init bfin_flash_init(void) | 193 | module_platform_driver(bfin_flash_driver); |
194 | { | ||
195 | return platform_driver_register(&bfin_flash_driver); | ||
196 | } | ||
197 | module_init(bfin_flash_init); | ||
198 | |||
199 | static void __exit bfin_flash_exit(void) | ||
200 | { | ||
201 | platform_driver_unregister(&bfin_flash_driver); | ||
202 | } | ||
203 | module_exit(bfin_flash_exit); | ||
204 | 194 | ||
205 | MODULE_LICENSE("GPL"); | 195 | MODULE_LICENSE("GPL"); |
206 | MODULE_DESCRIPTION("MTD map driver for Blackfins with flash/ethernet on same async bank"); | 196 | MODULE_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 | ||
282 | static int __init gpio_flash_init(void) | 282 | module_platform_driver(gpio_flash_driver); |
283 | { | ||
284 | return platform_driver_register(&gpio_flash_driver); | ||
285 | } | ||
286 | module_init(gpio_flash_init); | ||
287 | |||
288 | static void __exit gpio_flash_exit(void) | ||
289 | { | ||
290 | platform_driver_unregister(&gpio_flash_driver); | ||
291 | } | ||
292 | module_exit(gpio_flash_exit); | ||
293 | 283 | ||
294 | MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>"); | 284 | MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>"); |
295 | MODULE_DESCRIPTION("MTD map driver for flashes addressed physically and with gpios"); | 285 | MODULE_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 | ||
249 | static int __init ixp2000_flash_init(void) | 249 | module_platform_driver(ixp2000_flash_driver); |
250 | { | ||
251 | return platform_driver_register(&ixp2000_flash_driver); | ||
252 | } | ||
253 | |||
254 | static void __exit ixp2000_flash_exit(void) | ||
255 | { | ||
256 | platform_driver_unregister(&ixp2000_flash_driver); | ||
257 | } | ||
258 | 250 | ||
259 | module_init(ixp2000_flash_init); | ||
260 | module_exit(ixp2000_flash_exit); | ||
261 | MODULE_LICENSE("GPL"); | 251 | MODULE_LICENSE("GPL"); |
262 | MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>"); | 252 | MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>"); |
263 | MODULE_ALIAS("platform:IXP2000-Flash"); | 253 | MODULE_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 | ||
273 | static int __init ixp4xx_flash_init(void) | 273 | module_platform_driver(ixp4xx_flash_driver); |
274 | { | ||
275 | return platform_driver_register(&ixp4xx_flash_driver); | ||
276 | } | ||
277 | |||
278 | static void __exit ixp4xx_flash_exit(void) | ||
279 | { | ||
280 | platform_driver_unregister(&ixp4xx_flash_driver); | ||
281 | } | ||
282 | |||
283 | |||
284 | module_init(ixp4xx_flash_init); | ||
285 | module_exit(ixp4xx_flash_exit); | ||
286 | 274 | ||
287 | MODULE_LICENSE("GPL"); | 275 | MODULE_LICENSE("GPL"); |
288 | MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems"); | 276 | MODULE_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 | ||
226 | static int __init latch_addr_flash_init(void) | 226 | module_platform_driver(latch_addr_flash_driver); |
227 | { | ||
228 | return platform_driver_register(&latch_addr_flash_driver); | ||
229 | } | ||
230 | module_init(latch_addr_flash_init); | ||
231 | |||
232 | static void __exit latch_addr_flash_exit(void) | ||
233 | { | ||
234 | platform_driver_unregister(&latch_addr_flash_driver); | ||
235 | } | ||
236 | module_exit(latch_addr_flash_exit); | ||
237 | 227 | ||
238 | MODULE_AUTHOR("David Griego <dgriego@mvista.com>"); | 228 | MODULE_AUTHOR("David Griego <dgriego@mvista.com>"); |
239 | MODULE_DESCRIPTION("MTD map driver for flashes addressed physically with upper " | 229 | MODULE_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 | ||
341 | static int __init of_flash_init(void) | 341 | module_platform_driver(of_flash_driver); |
342 | { | ||
343 | return platform_driver_register(&of_flash_driver); | ||
344 | } | ||
345 | |||
346 | static void __exit of_flash_exit(void) | ||
347 | { | ||
348 | platform_driver_unregister(&of_flash_driver); | ||
349 | } | ||
350 | |||
351 | module_init(of_flash_init); | ||
352 | module_exit(of_flash_exit); | ||
353 | 342 | ||
354 | MODULE_LICENSE("GPL"); | 343 | MODULE_LICENSE("GPL"); |
355 | MODULE_AUTHOR("Vitaly Wool <vwool@ru.mvista.com>"); | 344 | MODULE_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 | ||
145 | static int __init init_pxa2xx_flash(void) | 145 | module_platform_driver(pxa2xx_flash_driver); |
146 | { | ||
147 | return platform_driver_register(&pxa2xx_flash_driver); | ||
148 | } | ||
149 | |||
150 | static void __exit cleanup_pxa2xx_flash(void) | ||
151 | { | ||
152 | platform_driver_unregister(&pxa2xx_flash_driver); | ||
153 | } | ||
154 | |||
155 | module_init(init_pxa2xx_flash); | ||
156 | module_exit(cleanup_pxa2xx_flash); | ||
157 | 146 | ||
158 | MODULE_LICENSE("GPL"); | 147 | MODULE_LICENSE("GPL"); |
159 | MODULE_AUTHOR("Nicolas Pitre <nico@fluxnic.net>"); | 148 | MODULE_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 | ||
140 | static int __init rbtx4939_flash_init(void) | 140 | module_platform_driver(rbtx4939_flash_driver); |
141 | { | ||
142 | return platform_driver_register(&rbtx4939_flash_driver); | ||
143 | } | ||
144 | |||
145 | static void __exit rbtx4939_flash_exit(void) | ||
146 | { | ||
147 | platform_driver_unregister(&rbtx4939_flash_driver); | ||
148 | } | ||
149 | |||
150 | module_init(rbtx4939_flash_init); | ||
151 | module_exit(rbtx4939_flash_exit); | ||
152 | 141 | ||
153 | MODULE_LICENSE("GPL"); | 142 | MODULE_LICENSE("GPL"); |
154 | MODULE_DESCRIPTION("RBTX4939 MTD map driver"); | 143 | MODULE_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 | ||
397 | static int __init sa1100_mtd_init(void) | 397 | module_platform_driver(sa1100_mtd_driver); |
398 | { | ||
399 | return platform_driver_register(&sa1100_mtd_driver); | ||
400 | } | ||
401 | |||
402 | static void __exit sa1100_mtd_exit(void) | ||
403 | { | ||
404 | platform_driver_unregister(&sa1100_mtd_driver); | ||
405 | } | ||
406 | |||
407 | module_init(sa1100_mtd_init); | ||
408 | module_exit(sa1100_mtd_exit); | ||
409 | 398 | ||
410 | MODULE_AUTHOR("Nicolas Pitre"); | 399 | MODULE_AUTHOR("Nicolas Pitre"); |
411 | MODULE_DESCRIPTION("SA1100 CFI map driver"); | 400 | MODULE_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 | ||
161 | static int __init uflash_init(void) | 161 | module_platform_driver(uflash_driver); |
162 | { | ||
163 | return platform_driver_register(&uflash_driver); | ||
164 | } | ||
165 | |||
166 | static void __exit uflash_exit(void) | ||
167 | { | ||
168 | platform_driver_unregister(&uflash_driver); | ||
169 | } | ||
170 | |||
171 | module_init(uflash_init); | ||
172 | module_exit(uflash_exit); | ||