rtc: convert rtc spi drivers to module_spi_driver
authorAxel Lin <axel.lin@gmail.com>
Fri, 23 Mar 2012 22:02:30 +0000 (15:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 23 Mar 2012 23:58:39 +0000 (16:58 -0700)
Factor out some boilerplate code for spi driver registration into
module_spi_driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Mark Jackson <mpfj@mimc.co.uk>
Cc: Dennis Aberilla <denzzzhome@yahoo.com>
Cc: Nikolaus Voss <n.voss@weinmann.de>
Cc: "Kim B. Heino" <Kim.Heino@bluegiga.com>
Cc: Raphael Assenat <raph@raphnet.net>
Cc: Chris Verges <chrisv@cyberswitching.com>
Cc: Magnus Damm <damm@opensource.se>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-ds1305.c
drivers/rtc/rtc-ds1390.c
drivers/rtc/rtc-ds3234.c
drivers/rtc/rtc-m41t93.c
drivers/rtc/rtc-m41t94.c
drivers/rtc/rtc-max6902.c
drivers/rtc/rtc-pcf2123.c
drivers/rtc/rtc-r9701.c
drivers/rtc/rtc-rs5c348.c

index 3a33b1fdbe0f84e54539a5c5383c26c6bcc9c04a..686a865913e19c9f1bbc896074aa253e6da5b3f0 100644 (file)
@@ -814,17 +814,7 @@ static struct spi_driver ds1305_driver = {
        /* REVISIT add suspend/resume */
 };
 
-static int __init ds1305_init(void)
-{
-       return spi_register_driver(&ds1305_driver);
-}
-module_init(ds1305_init);
-
-static void __exit ds1305_exit(void)
-{
-       spi_unregister_driver(&ds1305_driver);
-}
-module_exit(ds1305_exit);
+module_spi_driver(ds1305_driver);
 
 MODULE_DESCRIPTION("RTC driver for DS1305 and DS1306 chips");
 MODULE_LICENSE("GPL");
index b038d2cfef267163699fb502a4c3d2d533a58e75..b0a99e1b25be96684d821351312da7aa0e025c8b 100644 (file)
@@ -175,17 +175,7 @@ static struct spi_driver ds1390_driver = {
        .remove = __devexit_p(ds1390_remove),
 };
 
-static __init int ds1390_init(void)
-{
-       return spi_register_driver(&ds1390_driver);
-}
-module_init(ds1390_init);
-
-static __exit void ds1390_exit(void)
-{
-       spi_unregister_driver(&ds1390_driver);
-}
-module_exit(ds1390_exit);
+module_spi_driver(ds1390_driver);
 
 MODULE_DESCRIPTION("Dallas/Maxim DS1390/93/94 SPI RTC driver");
 MODULE_AUTHOR("Mark Jackson <mpfj@mimc.co.uk>");
index bbd26228f5326f337e86af8c624736d5c9c82ede..fda707926f022b26646342369db135d04e32e9ec 100644 (file)
@@ -173,17 +173,7 @@ static struct spi_driver ds3234_driver = {
        .remove = __devexit_p(ds3234_remove),
 };
 
-static __init int ds3234_init(void)
-{
-       return spi_register_driver(&ds3234_driver);
-}
-module_init(ds3234_init);
-
-static __exit void ds3234_exit(void)
-{
-       spi_unregister_driver(&ds3234_driver);
-}
-module_exit(ds3234_exit);
+module_spi_driver(ds3234_driver);
 
 MODULE_DESCRIPTION("DS3234 SPI RTC driver");
 MODULE_AUTHOR("Dennis Aberilla <denzzzhome@yahoo.com>");
index ef71132ff205fc1ef0faec00ba55cdea383622fa..10f1c29436ec59946123e5f2830f83e44a6c2ebc 100644 (file)
@@ -206,17 +206,7 @@ static struct spi_driver m41t93_driver = {
        .remove = __devexit_p(m41t93_remove),
 };
 
-static __init int m41t93_init(void)
-{
-       return spi_register_driver(&m41t93_driver);
-}
-module_init(m41t93_init);
-
-static __exit void m41t93_exit(void)
-{
-       spi_unregister_driver(&m41t93_driver);
-}
-module_exit(m41t93_exit);
+module_spi_driver(m41t93_driver);
 
 MODULE_AUTHOR("Nikolaus Voss <n.voss@weinmann.de>");
 MODULE_DESCRIPTION("Driver for ST M41T93 SPI RTC");
index 2a4721f617975bbb21db850418c5a41976fe5d89..6e78193e026b8b2c38599d62cde552a2ba7864b4 100644 (file)
@@ -153,19 +153,7 @@ static struct spi_driver m41t94_driver = {
        .remove = __devexit_p(m41t94_remove),
 };
 
-static __init int m41t94_init(void)
-{
-       return spi_register_driver(&m41t94_driver);
-}
-
-module_init(m41t94_init);
-
-static __exit void m41t94_exit(void)
-{
-       spi_unregister_driver(&m41t94_driver);
-}
-
-module_exit(m41t94_exit);
+module_spi_driver(m41t94_driver);
 
 MODULE_AUTHOR("Kim B. Heino <Kim.Heino@bluegiga.com>");
 MODULE_DESCRIPTION("Driver for ST M41T94 SPI RTC");
index 1f6b3cc58e8a3644e1412f77808464412540c37a..36c74d22e8b50a490082745b435aa284e37a4eb7 100644 (file)
@@ -160,17 +160,7 @@ static struct spi_driver max6902_driver = {
        .remove = __devexit_p(max6902_remove),
 };
 
-static __init int max6902_init(void)
-{
-       return spi_register_driver(&max6902_driver);
-}
-module_init(max6902_init);
-
-static __exit void max6902_exit(void)
-{
-       spi_unregister_driver(&max6902_driver);
-}
-module_exit(max6902_exit);
+module_spi_driver(max6902_driver);
 
 MODULE_DESCRIPTION ("max6902 spi RTC driver");
 MODULE_AUTHOR ("Raphael Assenat");
index b46c4004d8fe4e5728221857806c7878d14ba63c..836118795c0bdb4f0ad5874a3b3dc50dee5ffd69 100644 (file)
@@ -346,20 +346,9 @@ static struct spi_driver pcf2123_driver = {
        .remove = __devexit_p(pcf2123_remove),
 };
 
-static int __init pcf2123_init(void)
-{
-       return spi_register_driver(&pcf2123_driver);
-}
-
-static void __exit pcf2123_exit(void)
-{
-       spi_unregister_driver(&pcf2123_driver);
-}
+module_spi_driver(pcf2123_driver);
 
 MODULE_AUTHOR("Chris Verges <chrisv@cyberswitching.com>");
 MODULE_DESCRIPTION("NXP PCF2123 RTC driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
-
-module_init(pcf2123_init);
-module_exit(pcf2123_exit);
index 2853c2a6f10f4a055d2aadb8d3fac0380bff7f97..7f8e6c247935d36ba3b79ffcc835374cadbaa60d 100644 (file)
@@ -159,17 +159,7 @@ static struct spi_driver r9701_driver = {
        .remove = __devexit_p(r9701_remove),
 };
 
-static __init int r9701_init(void)
-{
-       return spi_register_driver(&r9701_driver);
-}
-module_init(r9701_init);
-
-static __exit void r9701_exit(void)
-{
-       spi_unregister_driver(&r9701_driver);
-}
-module_exit(r9701_exit);
+module_spi_driver(r9701_driver);
 
 MODULE_DESCRIPTION("r9701 spi RTC driver");
 MODULE_AUTHOR("Magnus Damm <damm@opensource.se>");
index ce2ca8523ddd5d01146c1b17c64069e76dbc0229..77074ccd285071f345118079a4f7c3120e6b86a3 100644 (file)
@@ -235,18 +235,7 @@ static struct spi_driver rs5c348_driver = {
        .remove = __devexit_p(rs5c348_remove),
 };
 
-static __init int rs5c348_init(void)
-{
-       return spi_register_driver(&rs5c348_driver);
-}
-
-static __exit void rs5c348_exit(void)
-{
-       spi_unregister_driver(&rs5c348_driver);
-}
-
-module_init(rs5c348_init);
-module_exit(rs5c348_exit);
+module_spi_driver(rs5c348_driver);
 
 MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
 MODULE_DESCRIPTION("Ricoh RS5C348 RTC driver");