mtd: use module_pci_driver
authorAxel Lin <axel.lin@gmail.com>
Tue, 3 Apr 2012 01:59:44 +0000 (09:59 +0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 14 May 2012 03:47:19 +0000 (22:47 -0500)
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>
drivers/mtd/maps/intel_vr_nor.c
drivers/mtd/maps/pci.c
drivers/mtd/maps/scb2_flash.c
drivers/mtd/nand/cafe_nand.c
drivers/mtd/nand/denali.c
drivers/mtd/nand/r852.c

index 92e1f41634c7135ffc1b39d50c0323f0de33c603..93f03175c82dce9185f5144e8bc129f849165764 100644 (file)
@@ -260,18 +260,7 @@ static struct pci_driver vr_nor_pci_driver = {
        .id_table = vr_nor_pci_ids,
 };
 
-static int __init vr_nor_mtd_init(void)
-{
-       return pci_register_driver(&vr_nor_pci_driver);
-}
-
-static void __exit vr_nor_mtd_exit(void)
-{
-       pci_unregister_driver(&vr_nor_pci_driver);
-}
-
-module_init(vr_nor_mtd_init);
-module_exit(vr_nor_mtd_exit);
+module_pci_driver(vr_nor_pci_driver);
 
 MODULE_AUTHOR("Andy Lowe");
 MODULE_DESCRIPTION("MTD map driver for NOR flash on Intel Vermilion Range");
index 1d005a3e9b41603856c40a60fee6de972771634f..f14ce0af763f0dda66a831470319e23611152eb2 100644 (file)
@@ -352,18 +352,7 @@ static struct pci_driver mtd_pci_driver = {
        .id_table =     mtd_pci_ids,
 };
 
-static int __init mtd_pci_maps_init(void)
-{
-       return pci_register_driver(&mtd_pci_driver);
-}
-
-static void __exit mtd_pci_maps_exit(void)
-{
-       pci_unregister_driver(&mtd_pci_driver);
-}
-
-module_init(mtd_pci_maps_init);
-module_exit(mtd_pci_maps_exit);
+module_pci_driver(mtd_pci_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
index 934a72c8007880407247915d1d814225c45d65f2..9dcbc684abdb27e9e0218a585bdbc1aa079e93af 100644 (file)
@@ -234,20 +234,7 @@ static struct pci_driver scb2_flash_driver = {
        .remove =   __devexit_p(scb2_flash_remove),
 };
 
-static int __init
-scb2_flash_init(void)
-{
-       return pci_register_driver(&scb2_flash_driver);
-}
-
-static void __exit
-scb2_flash_exit(void)
-{
-       pci_unregister_driver(&scb2_flash_driver);
-}
-
-module_init(scb2_flash_init);
-module_exit(scb2_flash_exit);
+module_pci_driver(scb2_flash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Tim Hockin <thockin@sun.com>");
index 2a96e1a12062314234f2cd74b86163029abc3e3d..2973d97bd529b2fc2cdeb369e59577ddbdb1d0bb 100644 (file)
@@ -888,17 +888,7 @@ static struct pci_driver cafe_nand_pci_driver = {
        .resume = cafe_nand_resume,
 };
 
-static int __init cafe_nand_init(void)
-{
-       return pci_register_driver(&cafe_nand_pci_driver);
-}
-
-static void __exit cafe_nand_exit(void)
-{
-       pci_unregister_driver(&cafe_nand_pci_driver);
-}
-module_init(cafe_nand_init);
-module_exit(cafe_nand_exit);
+module_pci_driver(cafe_nand_pci_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
index a9e57d686297096e0700935a90d6a5257aa789ff..a1048c7c5d2c747ae75cc924ff4876d3bade156a 100644 (file)
@@ -1702,17 +1702,4 @@ static struct pci_driver denali_pci_driver = {
        .remove = denali_pci_remove,
 };
 
-static int __devinit denali_init(void)
-{
-       printk(KERN_INFO "Spectra MTD driver\n");
-       return pci_register_driver(&denali_pci_driver);
-}
-
-/* Free memory */
-static void __devexit denali_exit(void)
-{
-       pci_unregister_driver(&denali_pci_driver);
-}
-
-module_init(denali_init);
-module_exit(denali_exit);
+module_pci_driver(denali_pci_driver);
index c2040187c813e0084e6dc7da8441c675bbe6cc3e..859ef318e5dc725ef25952df8fa452b02811dba3 100644 (file)
@@ -1104,18 +1104,7 @@ static struct pci_driver r852_pci_driver = {
        .driver.pm      = &r852_pm_ops,
 };
 
-static __init int r852_module_init(void)
-{
-       return pci_register_driver(&r852_pci_driver);
-}
-
-static void __exit r852_module_exit(void)
-{
-       pci_unregister_driver(&r852_pci_driver);
-}
-
-module_init(r852_module_init);
-module_exit(r852_module_exit);
+module_pci_driver(r852_pci_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Maxim Levitsky <maximlevitsky@gmail.com>");