]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Input: convert SPI drivers to use module_spi_driver()
authorAxel Lin <axel.lin@gmail.com>
Sat, 17 Mar 2012 06:05:26 +0000 (23:05 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 17 Mar 2012 06:06:11 +0000 (23:06 -0700)
This patch converts the drivers in drivers/input/* 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: Dmitry Torokhov <dtor@mail.ru>
drivers/input/misc/ad714x-spi.c
drivers/input/misc/adxl34x-spi.c
drivers/input/touchscreen/ad7877.c
drivers/input/touchscreen/ad7879-spi.c
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/cyttsp_spi.c
drivers/input/touchscreen/tsc2005.c

index 875b50811361cef62ca8e1e1b009b120121bfe66..75f6136d608e98da2b8c95f51361507a6faca380 100644 (file)
@@ -123,17 +123,7 @@ static struct spi_driver ad714x_spi_driver = {
        .remove         = __devexit_p(ad714x_spi_remove),
 };
 
-static __init int ad714x_spi_init(void)
-{
-       return spi_register_driver(&ad714x_spi_driver);
-}
-module_init(ad714x_spi_init);
-
-static __exit void ad714x_spi_exit(void)
-{
-       spi_unregister_driver(&ad714x_spi_driver);
-}
-module_exit(ad714x_spi_exit);
+module_spi_driver(ad714x_spi_driver);
 
 MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor SPI Bus Driver");
 MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
index 34d401efd4a168f0364bf48f9eafc7a2a3a2f5a9..820a802a1e6e19c51934efc9b1dbc18eb6e00f4b 100644 (file)
@@ -129,17 +129,7 @@ static struct spi_driver adxl34x_driver = {
        .remove  = __devexit_p(adxl34x_spi_remove),
 };
 
-static int __init adxl34x_spi_init(void)
-{
-       return spi_register_driver(&adxl34x_driver);
-}
-module_init(adxl34x_spi_init);
-
-static void __exit adxl34x_spi_exit(void)
-{
-       spi_unregister_driver(&adxl34x_driver);
-}
-module_exit(adxl34x_spi_exit);
+module_spi_driver(adxl34x_driver);
 
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("ADXL345/346 Three-Axis Digital Accelerometer SPI Bus Driver");
index 49a36df0b752929c522e67dbae73383de5273d49..2c7692108e6c23dfee071e4399f00b01ba4892ee 100644 (file)
@@ -860,17 +860,7 @@ static struct spi_driver ad7877_driver = {
        .remove         = __devexit_p(ad7877_remove),
 };
 
-static int __init ad7877_init(void)
-{
-       return spi_register_driver(&ad7877_driver);
-}
-module_init(ad7877_init);
-
-static void __exit ad7877_exit(void)
-{
-       spi_unregister_driver(&ad7877_driver);
-}
-module_exit(ad7877_exit);
+module_spi_driver(ad7877_driver);
 
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("AD7877 touchscreen Driver");
index 9b2e1c2b197198796992183a90a10927c073a57b..db49abf056ba643cc43bff7a323bac3a171e532d 100644 (file)
@@ -157,17 +157,7 @@ static struct spi_driver ad7879_spi_driver = {
        .remove         = __devexit_p(ad7879_spi_remove),
 };
 
-static int __init ad7879_spi_init(void)
-{
-       return spi_register_driver(&ad7879_spi_driver);
-}
-module_init(ad7879_spi_init);
-
-static void __exit ad7879_spi_exit(void)
-{
-       spi_unregister_driver(&ad7879_spi_driver);
-}
-module_exit(ad7879_spi_exit);
+module_spi_driver(ad7879_spi_driver);
 
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("AD7879(-1) touchscreen SPI bus driver");
index 23fd90185659036681de4685f2347f0d23749c5a..f02028ec3db6a6384dc194e7633ee12e8bbb7685 100644 (file)
@@ -1433,17 +1433,7 @@ static struct spi_driver ads7846_driver = {
        .remove         = __devexit_p(ads7846_remove),
 };
 
-static int __init ads7846_init(void)
-{
-       return spi_register_driver(&ads7846_driver);
-}
-module_init(ads7846_init);
-
-static void __exit ads7846_exit(void)
-{
-       spi_unregister_driver(&ads7846_driver);
-}
-module_exit(ads7846_exit);
+module_spi_driver(ads7846_driver);
 
 MODULE_DESCRIPTION("ADS7846 TouchScreen Driver");
 MODULE_LICENSE("GPL");
index 9db5f8754d101a5200f62cf2bec6c32eade40fb1..9f263410407b47950034937fd20490ee861fa4ac 100644 (file)
@@ -191,17 +191,7 @@ static struct spi_driver cyttsp_spi_driver = {
        .remove = __devexit_p(cyttsp_spi_remove),
 };
 
-static int __init cyttsp_spi_init(void)
-{
-       return spi_register_driver(&cyttsp_spi_driver);
-}
-module_init(cyttsp_spi_init);
-
-static void __exit cyttsp_spi_exit(void)
-{
-       spi_unregister_driver(&cyttsp_spi_driver);
-}
-module_exit(cyttsp_spi_exit);
+module_spi_driver(cyttsp_spi_driver);
 
 MODULE_ALIAS("spi:cyttsp");
 MODULE_LICENSE("GPL");
index 067d9566299731bf4c6ec5262dbabca2fcf1f981..b6adeaee9cc5f0f226781f59ba79961fd9eb1e0b 100644 (file)
@@ -747,17 +747,7 @@ static struct spi_driver tsc2005_driver = {
        .remove = __devexit_p(tsc2005_remove),
 };
 
-static int __init tsc2005_init(void)
-{
-       return spi_register_driver(&tsc2005_driver);
-}
-module_init(tsc2005_init);
-
-static void __exit tsc2005_exit(void)
-{
-       spi_unregister_driver(&tsc2005_driver);
-}
-module_exit(tsc2005_exit);
+module_spi_driver(tsc2005_driver);
 
 MODULE_AUTHOR("Lauri Leukkunen <lauri.leukkunen@nokia.com>");
 MODULE_DESCRIPTION("TSC2005 Touchscreen Driver");