]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mtd: convert drivers/mtd/* to use module_spi_driver()
authorAxel Lin <axel.lin@gmail.com>
Fri, 27 Jan 2012 07:45:20 +0000 (15:45 +0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:16:18 +0000 (00:16 +0100)
This patch converts the drivers in drivers/mtd/* to use the
module_spi_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/devices/m25p80.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/devices/sst25l.c

index 7c60dddbefc0ba055551559c5f2046b10e37eecd..230b02e336ab8e1b0c539d721b9be25769129858 100644 (file)
@@ -1004,21 +1004,7 @@ static struct spi_driver m25p80_driver = {
         */
 };
 
-
-static int __init m25p80_init(void)
-{
-       return spi_register_driver(&m25p80_driver);
-}
-
-
-static void __exit m25p80_exit(void)
-{
-       spi_unregister_driver(&m25p80_driver);
-}
-
-
-module_init(m25p80_init);
-module_exit(m25p80_exit);
+module_spi_driver(m25p80_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mike Lavender");
index 236057ead0d2ab2fcd5d57bff92e18a05e927223..5ec5fc9fe045efd5d12297eaef5fd4e14317d08c 100644 (file)
@@ -946,18 +946,7 @@ static struct spi_driver dataflash_driver = {
        /* FIXME:  investigate suspend and resume... */
 };
 
-static int __init dataflash_init(void)
-{
-       return spi_register_driver(&dataflash_driver);
-}
-module_init(dataflash_init);
-
-static void __exit dataflash_exit(void)
-{
-       spi_unregister_driver(&dataflash_driver);
-}
-module_exit(dataflash_exit);
-
+module_spi_driver(dataflash_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Andrew Victor, David Brownell");
index 5fc198350b94b66ea27b5e7113f4f192c61c9dfd..196fd95b19d6161cc127c66f3807505fe0515e0a 100644 (file)
@@ -450,18 +450,7 @@ static struct spi_driver sst25l_driver = {
        .remove         = __devexit_p(sst25l_remove),
 };
 
-static int __init sst25l_init(void)
-{
-       return spi_register_driver(&sst25l_driver);
-}
-
-static void __exit sst25l_exit(void)
-{
-       spi_unregister_driver(&sst25l_driver);
-}
-
-module_init(sst25l_init);
-module_exit(sst25l_exit);
+module_spi_driver(sst25l_driver);
 
 MODULE_DESCRIPTION("MTD SPI driver for SST25L Flash chips");
 MODULE_AUTHOR("Andre Renaud <andre@bluewatersys.com>, "