diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-02 21:59:44 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-13 23:47:19 -0400 |
commit | 4d16cd658700a36af8788a09b4789d09da355a8c (patch) | |
tree | 2674d8ff91911be1b278fcadce616254e6bedf56 /drivers/mtd/maps | |
parent | 4aa6ae3ecca04d7956817170418c74861ce071de (diff) |
mtd: use module_pci_driver
This patch converts the drivers in drivers/mtd/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.
Signed-off-by: Axel Lin <axel.lin@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/intel_vr_nor.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/pci.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/scb2_flash.c | 15 |
3 files changed, 3 insertions, 38 deletions
diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c index 92e1f41634c7..93f03175c82d 100644 --- a/drivers/mtd/maps/intel_vr_nor.c +++ b/drivers/mtd/maps/intel_vr_nor.c | |||
@@ -260,18 +260,7 @@ static struct pci_driver vr_nor_pci_driver = { | |||
260 | .id_table = vr_nor_pci_ids, | 260 | .id_table = vr_nor_pci_ids, |
261 | }; | 261 | }; |
262 | 262 | ||
263 | static int __init vr_nor_mtd_init(void) | 263 | module_pci_driver(vr_nor_pci_driver); |
264 | { | ||
265 | return pci_register_driver(&vr_nor_pci_driver); | ||
266 | } | ||
267 | |||
268 | static void __exit vr_nor_mtd_exit(void) | ||
269 | { | ||
270 | pci_unregister_driver(&vr_nor_pci_driver); | ||
271 | } | ||
272 | |||
273 | module_init(vr_nor_mtd_init); | ||
274 | module_exit(vr_nor_mtd_exit); | ||
275 | 264 | ||
276 | MODULE_AUTHOR("Andy Lowe"); | 265 | MODULE_AUTHOR("Andy Lowe"); |
277 | MODULE_DESCRIPTION("MTD map driver for NOR flash on Intel Vermilion Range"); | 266 | MODULE_DESCRIPTION("MTD map driver for NOR flash on Intel Vermilion Range"); |
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index 1d005a3e9b41..f14ce0af763f 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c | |||
@@ -352,18 +352,7 @@ static struct pci_driver mtd_pci_driver = { | |||
352 | .id_table = mtd_pci_ids, | 352 | .id_table = mtd_pci_ids, |
353 | }; | 353 | }; |
354 | 354 | ||
355 | static int __init mtd_pci_maps_init(void) | 355 | module_pci_driver(mtd_pci_driver); |
356 | { | ||
357 | return pci_register_driver(&mtd_pci_driver); | ||
358 | } | ||
359 | |||
360 | static void __exit mtd_pci_maps_exit(void) | ||
361 | { | ||
362 | pci_unregister_driver(&mtd_pci_driver); | ||
363 | } | ||
364 | |||
365 | module_init(mtd_pci_maps_init); | ||
366 | module_exit(mtd_pci_maps_exit); | ||
367 | 356 | ||
368 | MODULE_LICENSE("GPL"); | 357 | MODULE_LICENSE("GPL"); |
369 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); | 358 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); |
diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c index 934a72c80078..9dcbc684abdb 100644 --- a/drivers/mtd/maps/scb2_flash.c +++ b/drivers/mtd/maps/scb2_flash.c | |||
@@ -234,20 +234,7 @@ static struct pci_driver scb2_flash_driver = { | |||
234 | .remove = __devexit_p(scb2_flash_remove), | 234 | .remove = __devexit_p(scb2_flash_remove), |
235 | }; | 235 | }; |
236 | 236 | ||
237 | static int __init | 237 | module_pci_driver(scb2_flash_driver); |
238 | scb2_flash_init(void) | ||
239 | { | ||
240 | return pci_register_driver(&scb2_flash_driver); | ||
241 | } | ||
242 | |||
243 | static void __exit | ||
244 | scb2_flash_exit(void) | ||
245 | { | ||
246 | pci_unregister_driver(&scb2_flash_driver); | ||
247 | } | ||
248 | |||
249 | module_init(scb2_flash_init); | ||
250 | module_exit(scb2_flash_exit); | ||
251 | 238 | ||
252 | MODULE_LICENSE("GPL"); | 239 | MODULE_LICENSE("GPL"); |
253 | MODULE_AUTHOR("Tim Hockin <thockin@sun.com>"); | 240 | MODULE_AUTHOR("Tim Hockin <thockin@sun.com>"); |