Commit 91efffe2 authored by Axel Lin's avatar Axel Lin Committed by Guenter Roeck

hwmon: convert drivers/hwmon/* to use module_spi_driver()

This patch converts the drivers in drivers/hwmon/* to use the
module_spi_driver() macro which makes the code smaller and a bit simpler.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: Marc Pignat <marc.pignat@hevs.ch>
Cc: Paul Thomas <pthomas8589@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Acked-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent f0967eea
...@@ -167,17 +167,7 @@ static struct spi_driver ad7314_driver = { ...@@ -167,17 +167,7 @@ static struct spi_driver ad7314_driver = {
.id_table = ad7314_id, .id_table = ad7314_id,
}; };
static __init int ad7314_init(void) module_spi_driver(ad7314_driver);
{
return spi_register_driver(&ad7314_driver);
}
module_init(ad7314_init);
static __exit void ad7314_exit(void)
{
spi_unregister_driver(&ad7314_driver);
}
module_exit(ad7314_exit);
MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
MODULE_DESCRIPTION("Analog Devices AD7314, ADT7301 and ADT7302 digital" MODULE_DESCRIPTION("Analog Devices AD7314, ADT7301 and ADT7302 digital"
......
...@@ -248,18 +248,7 @@ static struct spi_driver adcxx_driver = { ...@@ -248,18 +248,7 @@ static struct spi_driver adcxx_driver = {
.remove = __devexit_p(adcxx_remove), .remove = __devexit_p(adcxx_remove),
}; };
static int __init init_adcxx(void) module_spi_driver(adcxx_driver);
{
return spi_register_driver(&adcxx_driver);
}
static void __exit exit_adcxx(void)
{
spi_unregister_driver(&adcxx_driver);
}
module_init(init_adcxx);
module_exit(exit_adcxx);
MODULE_AUTHOR("Marc Pignat"); MODULE_AUTHOR("Marc Pignat");
MODULE_DESCRIPTION("National Semiconductor adcxx8sxxx Linux driver"); MODULE_DESCRIPTION("National Semiconductor adcxx8sxxx Linux driver");
......
...@@ -234,18 +234,7 @@ static struct spi_driver ads7871_driver = { ...@@ -234,18 +234,7 @@ static struct spi_driver ads7871_driver = {
.remove = __devexit_p(ads7871_remove), .remove = __devexit_p(ads7871_remove),
}; };
static int __init ads7871_init(void) module_spi_driver(ads7871_driver);
{
return spi_register_driver(&ads7871_driver);
}
static void __exit ads7871_exit(void)
{
spi_unregister_driver(&ads7871_driver);
}
module_init(ads7871_init);
module_exit(ads7871_exit);
MODULE_AUTHOR("Paul Thomas <pthomas8589@gmail.com>"); MODULE_AUTHOR("Paul Thomas <pthomas8589@gmail.com>");
MODULE_DESCRIPTION("TI ADS7871 A/D driver"); MODULE_DESCRIPTION("TI ADS7871 A/D driver");
......
...@@ -213,18 +213,7 @@ static struct spi_driver lm70_driver = { ...@@ -213,18 +213,7 @@ static struct spi_driver lm70_driver = {
.remove = __devexit_p(lm70_remove), .remove = __devexit_p(lm70_remove),
}; };
static int __init init_lm70(void) module_spi_driver(lm70_driver);
{
return spi_register_driver(&lm70_driver);
}
static void __exit cleanup_lm70(void)
{
spi_unregister_driver(&lm70_driver);
}
module_init(init_lm70);
module_exit(cleanup_lm70);
MODULE_AUTHOR("Kaiwan N Billimoria"); MODULE_AUTHOR("Kaiwan N Billimoria");
MODULE_DESCRIPTION("NS LM70 / TI TMP121/TMP123 Linux driver"); MODULE_DESCRIPTION("NS LM70 / TI TMP121/TMP123 Linux driver");
......
...@@ -227,17 +227,7 @@ static struct spi_driver max1111_driver = { ...@@ -227,17 +227,7 @@ static struct spi_driver max1111_driver = {
.remove = __devexit_p(max1111_remove), .remove = __devexit_p(max1111_remove),
}; };
static int __init max1111_init(void) module_spi_driver(max1111_driver);
{
return spi_register_driver(&max1111_driver);
}
module_init(max1111_init);
static void __exit max1111_exit(void)
{
spi_unregister_driver(&max1111_driver);
}
module_exit(max1111_exit);
MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"); MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>");
MODULE_DESCRIPTION("MAX1111 ADC Driver"); MODULE_DESCRIPTION("MAX1111 ADC Driver");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment