linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
@ 2011-11-25  4:14 Axel Lin
  2011-11-25  4:16 ` [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver() Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Axel Lin @ 2011-11-25  4:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Michael Hennerich, Anantha Narayanan, Samu Onkalo, Hemanth V,
	Christoph Mair, Grant Likely, Ben Gardner, Minkyu Kang,
	Kalhan Trisal, Darrick J. Wong, Daniel Mack, Rodolfo Giometti,
	Arnd Bergmann, Greg Kroah-Hartman, Eric Piel, Anatolij Gustschin

This patch converts the drivers in drivers/misc/* to use the
module_i2c_driver() macro which makes the code smaller and a bit
simpler.

Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Cc: Anantha Narayanan <Anantha.Narayanan@intel.com>
Cc: Samu Onkalo <samu.p.onkalo@nokia.com>
Cc: Hemanth V <hemanthv@ti.com>
Cc: Christoph Mair <christoph.mair@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Ben Gardner <bgardner@wabtec.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Kalhan Trisal <kalhan.trisal@intel.com>
Cc: Darrick J. Wong <djwong@us.ibm.com>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/misc/ad525x_dpot-i2c.c         |   12 +-----------
 drivers/misc/apds9802als.c             |   12 +-----------
 drivers/misc/apds990x.c                |   13 +------------
 drivers/misc/bh1770glc.c               |   13 +------------
 drivers/misc/bh1780gli.c               |   15 ++-------------
 drivers/misc/bmp085.c                  |   14 +-------------
 drivers/misc/ds1682.c                  |   13 +------------
 drivers/misc/eeprom/eeprom.c           |   14 +-------------
 drivers/misc/eeprom/max6875.c          |   14 +-------------
 drivers/misc/fsa9480.c                 |   12 +-----------
 drivers/misc/hmc6352.c                 |   13 +------------
 drivers/misc/ics932s401.c              |   13 +------------
 drivers/misc/isl29003.c                |   14 +-------------
 drivers/misc/isl29020.c                |   13 +------------
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |   13 +------------
 drivers/misc/tsl2550.c                 |   13 +------------
 16 files changed, 17 insertions(+), 194 deletions(-)

diff --git a/drivers/misc/ad525x_dpot-i2c.c b/drivers/misc/ad525x_dpot-i2c.c
index 83adab6..8208262 100644
--- a/drivers/misc/ad525x_dpot-i2c.c
+++ b/drivers/misc/ad525x_dpot-i2c.c
@@ -113,17 +113,7 @@ static struct i2c_driver ad_dpot_i2c_driver = {
 	.id_table	= ad_dpot_id,
 };
 
-static int __init ad_dpot_i2c_init(void)
-{
-	return i2c_add_driver(&ad_dpot_i2c_driver);
-}
-module_init(ad_dpot_i2c_init);
-
-static void __exit ad_dpot_i2c_exit(void)
-{
-	i2c_del_driver(&ad_dpot_i2c_driver);
-}
-module_exit(ad_dpot_i2c_exit);
+module_i2c_driver(ad_dpot_i2c_driver);
 
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("digital potentiometer I2C bus driver");
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c
index 81db781..0314773 100644
--- a/drivers/misc/apds9802als.c
+++ b/drivers/misc/apds9802als.c
@@ -332,17 +332,7 @@ static struct i2c_driver apds9802als_driver = {
 	.id_table = apds9802als_id,
 };
 
-static int __init sensor_apds9802als_init(void)
-{
-	return i2c_add_driver(&apds9802als_driver);
-}
-
-static void  __exit sensor_apds9802als_exit(void)
-{
-	i2c_del_driver(&apds9802als_driver);
-}
-module_init(sensor_apds9802als_init);
-module_exit(sensor_apds9802als_exit);
+module_i2c_driver(apds9802als_driver);
 
 MODULE_AUTHOR("Anantha Narayanan <Anantha.Narayanan@intel.com");
 MODULE_DESCRIPTION("Avago apds9802als ALS Driver");
diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c
index e2a52e5..ee74244 100644
--- a/drivers/misc/apds990x.c
+++ b/drivers/misc/apds990x.c
@@ -1279,19 +1279,8 @@ static struct i2c_driver apds990x_driver = {
 	.id_table = apds990x_id,
 };
 
-static int __init apds990x_init(void)
-{
-	return i2c_add_driver(&apds990x_driver);
-}
-
-static void __exit apds990x_exit(void)
-{
-	i2c_del_driver(&apds990x_driver);
-}
+module_i2c_driver(apds990x_driver);
 
 MODULE_DESCRIPTION("APDS990X combined ALS and proximity sensor");
 MODULE_AUTHOR("Samu Onkalo, Nokia Corporation");
 MODULE_LICENSE("GPL v2");
-
-module_init(apds990x_init);
-module_exit(apds990x_exit);
diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
index d79a972..3d56ae7 100644
--- a/drivers/misc/bh1770glc.c
+++ b/drivers/misc/bh1770glc.c
@@ -1399,19 +1399,8 @@ static struct i2c_driver bh1770_driver = {
 	.id_table = bh1770_id,
 };
 
-static int __init bh1770_init(void)
-{
-	return i2c_add_driver(&bh1770_driver);
-}
-
-static void __exit bh1770_exit(void)
-{
-	i2c_del_driver(&bh1770_driver);
-}
+module_i2c_driver(bh1770_driver);
 
 MODULE_DESCRIPTION("BH1770GLC / SFH7770 combined ALS and proximity sensor");
 MODULE_AUTHOR("Samu Onkalo, Nokia Corporation");
 MODULE_LICENSE("GPL v2");
-
-module_init(bh1770_init);
-module_exit(bh1770_exit);
diff --git a/drivers/misc/bh1780gli.c b/drivers/misc/bh1780gli.c
index bfeea9b..54f6f39 100644
--- a/drivers/misc/bh1780gli.c
+++ b/drivers/misc/bh1780gli.c
@@ -253,21 +253,10 @@ static struct i2c_driver bh1780_driver = {
 	.driver = {
 		.name = "bh1780",
 		.pm	= BH1780_PMOPS,
-},
+	},
 };
 
-static int __init bh1780_init(void)
-{
-	return i2c_add_driver(&bh1780_driver);
-}
-
-static void __exit bh1780_exit(void)
-{
-	i2c_del_driver(&bh1780_driver);
-}
-
-module_init(bh1780_init)
-module_exit(bh1780_exit)
+module_i2c_driver(bh1780_driver);
 
 MODULE_DESCRIPTION("BH1780GLI Ambient Light Sensor Driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/misc/bmp085.c b/drivers/misc/bmp085.c
index 5f898cb..ca4024d 100644
--- a/drivers/misc/bmp085.c
+++ b/drivers/misc/bmp085.c
@@ -464,20 +464,8 @@ static struct i2c_driver bmp085_driver = {
 	.address_list	= normal_i2c
 };
 
-static int __init bmp085_init(void)
-{
-	return i2c_add_driver(&bmp085_driver);
-}
-
-static void __exit bmp085_exit(void)
-{
-	i2c_del_driver(&bmp085_driver);
-}
-
+module_i2c_driver(bmp085_driver);
 
 MODULE_AUTHOR("Christoph Mair <christoph.mair@gmail.com");
 MODULE_DESCRIPTION("BMP085 driver");
 MODULE_LICENSE("GPL");
-
-module_init(bmp085_init);
-module_exit(bmp085_exit);
diff --git a/drivers/misc/ds1682.c b/drivers/misc/ds1682.c
index a513f0a..154b02e 100644
--- a/drivers/misc/ds1682.c
+++ b/drivers/misc/ds1682.c
@@ -250,19 +250,8 @@ static struct i2c_driver ds1682_driver = {
 	.id_table = ds1682_id,
 };
 
-static int __init ds1682_init(void)
-{
-	return i2c_add_driver(&ds1682_driver);
-}
-
-static void __exit ds1682_exit(void)
-{
-	i2c_del_driver(&ds1682_driver);
-}
+module_i2c_driver(ds1682_driver);
 
 MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
 MODULE_DESCRIPTION("DS1682 Elapsed Time Indicator driver");
 MODULE_LICENSE("GPL");
-
-module_init(ds1682_init);
-module_exit(ds1682_exit);
diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c
index 45060dd..c169e07 100644
--- a/drivers/misc/eeprom/eeprom.c
+++ b/drivers/misc/eeprom/eeprom.c
@@ -229,22 +229,10 @@ static struct i2c_driver eeprom_driver = {
 	.address_list	= normal_i2c,
 };
 
-static int __init eeprom_init(void)
-{
-	return i2c_add_driver(&eeprom_driver);
-}
-
-static void __exit eeprom_exit(void)
-{
-	i2c_del_driver(&eeprom_driver);
-}
-
+module_i2c_driver(eeprom_driver);
 
 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and "
 		"Philip Edelbrock <phil@netroedge.com> and "
 		"Greg Kroah-Hartman <greg@kroah.com>");
 MODULE_DESCRIPTION("I2C EEPROM driver");
 MODULE_LICENSE("GPL");
-
-module_init(eeprom_init);
-module_exit(eeprom_exit);
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c
index 5653a3c..e36157d 100644
--- a/drivers/misc/eeprom/max6875.c
+++ b/drivers/misc/eeprom/max6875.c
@@ -208,20 +208,8 @@ static struct i2c_driver max6875_driver = {
 	.id_table	= max6875_id,
 };
 
-static int __init max6875_init(void)
-{
-	return i2c_add_driver(&max6875_driver);
-}
-
-static void __exit max6875_exit(void)
-{
-	i2c_del_driver(&max6875_driver);
-}
-
+module_i2c_driver(max6875_driver);
 
 MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");
 MODULE_DESCRIPTION("MAX6875 driver");
 MODULE_LICENSE("GPL");
-
-module_init(max6875_init);
-module_exit(max6875_exit);
diff --git a/drivers/misc/fsa9480.c b/drivers/misc/fsa9480.c
index f6586d5..483d6b7 100644
--- a/drivers/misc/fsa9480.c
+++ b/drivers/misc/fsa9480.c
@@ -541,17 +541,7 @@ static struct i2c_driver fsa9480_i2c_driver = {
 	.id_table = fsa9480_id,
 };
 
-static int __init fsa9480_init(void)
-{
-	return i2c_add_driver(&fsa9480_i2c_driver);
-}
-module_init(fsa9480_init);
-
-static void __exit fsa9480_exit(void)
-{
-	i2c_del_driver(&fsa9480_i2c_driver);
-}
-module_exit(fsa9480_exit);
+module_i2c_driver(fsa9480_i2c_driver);
 
 MODULE_AUTHOR("Minkyu Kang <mk7.kang@samsung.com>");
 MODULE_DESCRIPTION("FSA9480 USB Switch driver");
diff --git a/drivers/misc/hmc6352.c b/drivers/misc/hmc6352.c
index ca938fc..423cd40 100644
--- a/drivers/misc/hmc6352.c
+++ b/drivers/misc/hmc6352.c
@@ -148,18 +148,7 @@ static struct i2c_driver hmc6352_driver = {
 	.id_table = hmc6352_id,
 };
 
-static int __init sensor_hmc6352_init(void)
-{
-	return i2c_add_driver(&hmc6352_driver);
-}
-
-static void  __exit sensor_hmc6352_exit(void)
-{
-	i2c_del_driver(&hmc6352_driver);
-}
-
-module_init(sensor_hmc6352_init);
-module_exit(sensor_hmc6352_exit);
+module_i2c_driver(hmc6352_driver);
 
 MODULE_AUTHOR("Kalhan Trisal <kalhan.trisal@intel.com");
 MODULE_DESCRIPTION("hmc6352 Compass Driver");
diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index 152e9d9..0029536 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -480,23 +480,12 @@ static int ics932s401_remove(struct i2c_client *client)
 	return 0;
 }
 
-static int __init ics932s401_init(void)
-{
-	return i2c_add_driver(&ics932s401_driver);
-}
-
-static void __exit ics932s401_exit(void)
-{
-	i2c_del_driver(&ics932s401_driver);
-}
+module_i2c_driver(ics932s401_driver);
 
 MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>");
 MODULE_DESCRIPTION("ICS932S401 driver");
 MODULE_LICENSE("GPL");
 
-module_init(ics932s401_init);
-module_exit(ics932s401_exit);
-
 /* IBM IntelliStation Z30 */
 MODULE_ALIAS("dmi:bvnIBM:*:rn9228:*");
 MODULE_ALIAS("dmi:bvnIBM:*:rn9232:*");
diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c
index a71e245..eb5de2e 100644
--- a/drivers/misc/isl29003.c
+++ b/drivers/misc/isl29003.c
@@ -455,21 +455,9 @@ static struct i2c_driver isl29003_driver = {
 	.id_table = isl29003_id,
 };
 
-static int __init isl29003_init(void)
-{
-	return i2c_add_driver(&isl29003_driver);
-}
-
-static void __exit isl29003_exit(void)
-{
-	i2c_del_driver(&isl29003_driver);
-}
+module_i2c_driver(isl29003_driver);
 
 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
 MODULE_DESCRIPTION("ISL29003 ambient light sensor driver");
 MODULE_LICENSE("GPL v2");
 MODULE_VERSION(DRIVER_VERSION);
-
-module_init(isl29003_init);
-module_exit(isl29003_exit);
-
diff --git a/drivers/misc/isl29020.c b/drivers/misc/isl29020.c
index 307aada..e24d22a 100644
--- a/drivers/misc/isl29020.c
+++ b/drivers/misc/isl29020.c
@@ -230,18 +230,7 @@ static struct i2c_driver isl29020_driver = {
 	.id_table = isl29020_id,
 };
 
-static int __init sensor_isl29020_init(void)
-{
-	return i2c_add_driver(&isl29020_driver);
-}
-
-static void  __exit sensor_isl29020_exit(void)
-{
-	i2c_del_driver(&isl29020_driver);
-}
-
-module_init(sensor_isl29020_init);
-module_exit(sensor_isl29020_exit);
+module_i2c_driver(isl29020_driver);
 
 MODULE_AUTHOR("Kalhan Trisal <kalhan.trisal@intel.com>");
 MODULE_DESCRIPTION("Intersil isl29020 ALS Driver");
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index c02fea0..e8c0019 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -256,19 +256,8 @@ static struct i2c_driver lis3lv02d_i2c_driver = {
 	.id_table = lis3lv02d_id,
 };
 
-static int __init lis3lv02d_init(void)
-{
-	return i2c_add_driver(&lis3lv02d_i2c_driver);
-}
-
-static void __exit lis3lv02d_exit(void)
-{
-	i2c_del_driver(&lis3lv02d_i2c_driver);
-}
+module_i2c_driver(lis3lv02d_i2c_driver);
 
 MODULE_AUTHOR("Nokia Corporation");
 MODULE_DESCRIPTION("lis3lv02d I2C interface");
 MODULE_LICENSE("GPL");
-
-module_init(lis3lv02d_init);
-module_exit(lis3lv02d_exit);
diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c
index 483ae5f..0beb298 100644
--- a/drivers/misc/tsl2550.c
+++ b/drivers/misc/tsl2550.c
@@ -454,20 +454,9 @@ static struct i2c_driver tsl2550_driver = {
 	.id_table = tsl2550_id,
 };
 
-static int __init tsl2550_init(void)
-{
-	return i2c_add_driver(&tsl2550_driver);
-}
-
-static void __exit tsl2550_exit(void)
-{
-	i2c_del_driver(&tsl2550_driver);
-}
+module_i2c_driver(tsl2550_driver);
 
 MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
 MODULE_DESCRIPTION("TSL2550 ambient light sensor driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRIVER_VERSION);
-
-module_init(tsl2550_init);
-module_exit(tsl2550_exit);
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver()
  2011-11-25  4:14 [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Axel Lin
@ 2011-11-25  4:16 ` Axel Lin
  2011-11-25  7:51   ` Michael Hennerich
  2011-11-25  8:30 ` [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Lars-Peter Clausen
  2011-11-27  4:16 ` Greg KH
  2 siblings, 1 reply; 9+ messages in thread
From: Axel Lin @ 2011-11-25  4:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Michael Hennerich, Anatolij Gustschin, Daniel Mack,
	Arnd Bergmann, Greg Kroah-Hartman

This patch converts the drivers in drivers/misc/* to use the
module_spi_driver() macro which makes the code smaller and a bit
simpler.

Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Daniel Mack <zonque@gmail.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/misc/ad525x_dpot-spi.c         |   12 +-----------
 drivers/misc/eeprom/at25.c             |   12 +-----------
 drivers/misc/eeprom/eeprom_93xx46.c    |   12 +-----------
 drivers/misc/lis3lv02d/lis3lv02d_spi.c |   13 +------------
 drivers/misc/ti_dac7512.c              |   13 +------------
 5 files changed, 5 insertions(+), 57 deletions(-)

diff --git a/drivers/misc/ad525x_dpot-spi.c b/drivers/misc/ad525x_dpot-spi.c
index 822749e..f623175 100644
--- a/drivers/misc/ad525x_dpot-spi.c
+++ b/drivers/misc/ad525x_dpot-spi.c
@@ -135,17 +135,7 @@ static struct spi_driver ad_dpot_spi_driver = {
 	.id_table	= ad_dpot_spi_id,
 };
 
-static int __init ad_dpot_spi_init(void)
-{
-	return spi_register_driver(&ad_dpot_spi_driver);
-}
-module_init(ad_dpot_spi_init);
-
-static void __exit ad_dpot_spi_exit(void)
-{
-	spi_unregister_driver(&ad_dpot_spi_driver);
-}
-module_exit(ad_dpot_spi_exit);
+module_spi_driver(ad_dpot_spi_driver);
 
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("digital potentiometer SPI bus driver");
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index c627e41..01ab3c9 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -405,17 +405,7 @@ static struct spi_driver at25_driver = {
 	.remove		= __devexit_p(at25_remove),
 };
 
-static int __init at25_init(void)
-{
-	return spi_register_driver(&at25_driver);
-}
-module_init(at25_init);
-
-static void __exit at25_exit(void)
-{
-	spi_unregister_driver(&at25_driver);
-}
-module_exit(at25_exit);
+module_spi_driver(at25_driver);
 
 MODULE_DESCRIPTION("Driver for most SPI EEPROMs");
 MODULE_AUTHOR("David Brownell");
diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
index 0c7ebb1..ce3fe36 100644
--- a/drivers/misc/eeprom/eeprom_93xx46.c
+++ b/drivers/misc/eeprom/eeprom_93xx46.c
@@ -392,17 +392,7 @@ static struct spi_driver eeprom_93xx46_driver = {
 	.remove		= __devexit_p(eeprom_93xx46_remove),
 };
 
-static int __init eeprom_93xx46_init(void)
-{
-	return spi_register_driver(&eeprom_93xx46_driver);
-}
-module_init(eeprom_93xx46_init);
-
-static void __exit eeprom_93xx46_exit(void)
-{
-	spi_unregister_driver(&eeprom_93xx46_driver);
-}
-module_exit(eeprom_93xx46_exit);
+module_spi_driver(eeprom_93xx46_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Driver for 93xx46 EEPROMs");
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
index b2c1be1..80880e9 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
@@ -126,18 +126,7 @@ static struct spi_driver lis302dl_spi_driver = {
 	.remove	= __devexit_p(lis302dl_spi_remove),
 };
 
-static int __init lis302dl_init(void)
-{
-	return spi_register_driver(&lis302dl_spi_driver);
-}
-
-static void __exit lis302dl_exit(void)
-{
-	spi_unregister_driver(&lis302dl_spi_driver);
-}
-
-module_init(lis302dl_init);
-module_exit(lis302dl_exit);
+module_spi_driver(lis302dl_spi_driver);
 
 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
 MODULE_DESCRIPTION("lis3lv02d SPI glue layer");
diff --git a/drivers/misc/ti_dac7512.c b/drivers/misc/ti_dac7512.c
index d3f229a..5acbba1 100644
--- a/drivers/misc/ti_dac7512.c
+++ b/drivers/misc/ti_dac7512.c
@@ -82,20 +82,9 @@ static struct spi_driver dac7512_driver = {
 	.remove	= __devexit_p(dac7512_remove),
 };
 
-static int __init dac7512_init(void)
-{
-	return spi_register_driver(&dac7512_driver);
-}
-
-static void __exit dac7512_exit(void)
-{
-	spi_unregister_driver(&dac7512_driver);
-}
+module_spi_driver(dac7512_driver);
 
 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
 MODULE_DESCRIPTION("DAC7512 16-bit DAC");
 MODULE_LICENSE("GPL v2");
 MODULE_VERSION(DRIVER_VERSION);
-
-module_init(dac7512_init);
-module_exit(dac7512_exit);
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver()
  2011-11-25  4:16 ` [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver() Axel Lin
@ 2011-11-25  7:51   ` Michael Hennerich
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Hennerich @ 2011-11-25  7:51 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Michael Hennerich, Anatolij Gustschin, Daniel Mack,
	Arnd Bergmann, Greg Kroah-Hartman, device-drivers-devel

On 11/25/2011 05:16 AM, Axel Lin wrote:
> This patch converts the drivers in drivers/misc/* to use the
> module_spi_driver() macro which makes the code smaller and a bit
> simpler.
>
> Cc: Michael Hennerich<hennerich@blackfin.uclinux.org>
> Cc: Anatolij Gustschin<agust@denx.de>
> Cc: Daniel Mack<zonque@gmail.com>
> Signed-off-by: Axel Lin<axel.lin@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
>   drivers/misc/ad525x_dpot-spi.c         |   12 +-----------
>   drivers/misc/eeprom/at25.c             |   12 +-----------
>   drivers/misc/eeprom/eeprom_93xx46.c    |   12 +-----------
>   drivers/misc/lis3lv02d/lis3lv02d_spi.c |   13 +------------
>   drivers/misc/ti_dac7512.c              |   13 +------------
>   5 files changed, 5 insertions(+), 57 deletions(-)
>
> diff --git a/drivers/misc/ad525x_dpot-spi.c b/drivers/misc/ad525x_dpot-spi.c
> index 822749e..f623175 100644
> --- a/drivers/misc/ad525x_dpot-spi.c
> +++ b/drivers/misc/ad525x_dpot-spi.c
> @@ -135,17 +135,7 @@ static struct spi_driver ad_dpot_spi_driver = {
>   	.id_table	= ad_dpot_spi_id,
>   };
>
> -static int __init ad_dpot_spi_init(void)
> -{
> -	return spi_register_driver(&ad_dpot_spi_driver);
> -}
> -module_init(ad_dpot_spi_init);
> -
> -static void __exit ad_dpot_spi_exit(void)
> -{
> -	spi_unregister_driver(&ad_dpot_spi_driver);
> -}
> -module_exit(ad_dpot_spi_exit);
> +module_spi_driver(ad_dpot_spi_driver);
>
>   MODULE_AUTHOR("Michael Hennerich<hennerich@blackfin.uclinux.org>");
>   MODULE_DESCRIPTION("digital potentiometer SPI bus driver");
> diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
> index c627e41..01ab3c9 100644
> --- a/drivers/misc/eeprom/at25.c
> +++ b/drivers/misc/eeprom/at25.c
> @@ -405,17 +405,7 @@ static struct spi_driver at25_driver = {
>   	.remove		= __devexit_p(at25_remove),
>   };
>
> -static int __init at25_init(void)
> -{
> -	return spi_register_driver(&at25_driver);
> -}
> -module_init(at25_init);
> -
> -static void __exit at25_exit(void)
> -{
> -	spi_unregister_driver(&at25_driver);
> -}
> -module_exit(at25_exit);
> +module_spi_driver(at25_driver);
>
>   MODULE_DESCRIPTION("Driver for most SPI EEPROMs");
>   MODULE_AUTHOR("David Brownell");
> diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
> index 0c7ebb1..ce3fe36 100644
> --- a/drivers/misc/eeprom/eeprom_93xx46.c
> +++ b/drivers/misc/eeprom/eeprom_93xx46.c
> @@ -392,17 +392,7 @@ static struct spi_driver eeprom_93xx46_driver = {
>   	.remove		= __devexit_p(eeprom_93xx46_remove),
>   };
>
> -static int __init eeprom_93xx46_init(void)
> -{
> -	return spi_register_driver(&eeprom_93xx46_driver);
> -}
> -module_init(eeprom_93xx46_init);
> -
> -static void __exit eeprom_93xx46_exit(void)
> -{
> -	spi_unregister_driver(&eeprom_93xx46_driver);
> -}
> -module_exit(eeprom_93xx46_exit);
> +module_spi_driver(eeprom_93xx46_driver);
>
>   MODULE_LICENSE("GPL");
>   MODULE_DESCRIPTION("Driver for 93xx46 EEPROMs");
> diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
> index b2c1be1..80880e9 100644
> --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c
> +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
> @@ -126,18 +126,7 @@ static struct spi_driver lis302dl_spi_driver = {
>   	.remove	= __devexit_p(lis302dl_spi_remove),
>   };
>
> -static int __init lis302dl_init(void)
> -{
> -	return spi_register_driver(&lis302dl_spi_driver);
> -}
> -
> -static void __exit lis302dl_exit(void)
> -{
> -	spi_unregister_driver(&lis302dl_spi_driver);
> -}
> -
> -module_init(lis302dl_init);
> -module_exit(lis302dl_exit);
> +module_spi_driver(lis302dl_spi_driver);
>
>   MODULE_AUTHOR("Daniel Mack<daniel@caiaq.de>");
>   MODULE_DESCRIPTION("lis3lv02d SPI glue layer");
> diff --git a/drivers/misc/ti_dac7512.c b/drivers/misc/ti_dac7512.c
> index d3f229a..5acbba1 100644
> --- a/drivers/misc/ti_dac7512.c
> +++ b/drivers/misc/ti_dac7512.c
> @@ -82,20 +82,9 @@ static struct spi_driver dac7512_driver = {
>   	.remove	= __devexit_p(dac7512_remove),
>   };
>
> -static int __init dac7512_init(void)
> -{
> -	return spi_register_driver(&dac7512_driver);
> -}
> -
> -static void __exit dac7512_exit(void)
> -{
> -	spi_unregister_driver(&dac7512_driver);
> -}
> +module_spi_driver(dac7512_driver);
>
>   MODULE_AUTHOR("Daniel Mack<daniel@caiaq.de>");
>   MODULE_DESCRIPTION("DAC7512 16-bit DAC");
>   MODULE_LICENSE("GPL v2");
>   MODULE_VERSION(DRIVER_VERSION);
> -
> -module_init(dac7512_init);
> -module_exit(dac7512_exit);


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
  2011-11-25  4:14 [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Axel Lin
  2011-11-25  4:16 ` [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver() Axel Lin
@ 2011-11-25  8:30 ` Lars-Peter Clausen
  2011-11-25 10:15   ` Arnd Bergmann
  2011-11-27  4:16 ` Greg KH
  2 siblings, 1 reply; 9+ messages in thread
From: Lars-Peter Clausen @ 2011-11-25  8:30 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Michael Hennerich, Anantha Narayanan, Samu Onkalo,
	Hemanth V, Christoph Mair, Grant Likely, Ben Gardner,
	Minkyu Kang, Kalhan Trisal, Darrick J. Wong, Daniel Mack,
	Rodolfo Giometti, Arnd Bergmann, Greg Kroah-Hartman, Eric Piel,
	Anatolij Gustschin

On 11/25/2011 05:14 AM, Axel Lin wrote:
> This patch converts the drivers in drivers/misc/* to use the
> module_i2c_driver() macro which makes the code smaller and a bit
> simpler.
> 

I think we should wait with spi and i2c patches until the macro can actually
be found in respective subsystem tree. Or do you want these patches to go
through GregKH's driver-core tree?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
  2011-11-25  8:30 ` [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Lars-Peter Clausen
@ 2011-11-25 10:15   ` Arnd Bergmann
  2011-11-25 10:40     ` Lars-Peter Clausen
  0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2011-11-25 10:15 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Axel Lin, linux-kernel, Michael Hennerich, Anantha Narayanan,
	Samu Onkalo, Hemanth V, Christoph Mair, Grant Likely,
	Ben Gardner, Minkyu Kang, Kalhan Trisal, Darrick J. Wong,
	Daniel Mack, Rodolfo Giometti, Greg Kroah-Hartman, Eric Piel,
	Anatolij Gustschin

On Friday 25 November 2011, Lars-Peter Clausen wrote:
> On 11/25/2011 05:14 AM, Axel Lin wrote:
> > This patch converts the drivers in drivers/misc/* to use the
> > module_i2c_driver() macro which makes the code smaller and a bit
> > simpler.

Acked-by: Arnd Bergmann <arnd@arndb.de>

> I think we should wait with spi and i2c patches until the macro can actually
> be found in respective subsystem tree. Or do you want these patches to go
> through GregKH's driver-core tree?

Obviously it can only go in after the patches introducing the macros.
Since Greg owns both the char-misc and driver-core trees, there should
be no problem coordinating between the two.

	Arnd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
  2011-11-25 10:15   ` Arnd Bergmann
@ 2011-11-25 10:40     ` Lars-Peter Clausen
  2011-11-25 13:58       ` Arnd Bergmann
  0 siblings, 1 reply; 9+ messages in thread
From: Lars-Peter Clausen @ 2011-11-25 10:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Axel Lin, linux-kernel, Michael Hennerich, Anantha Narayanan,
	Samu Onkalo, Hemanth V, Christoph Mair, Grant Likely,
	Ben Gardner, Minkyu Kang, Kalhan Trisal, Darrick J. Wong,
	Daniel Mack, Rodolfo Giometti, Greg Kroah-Hartman, Eric Piel,
	Anatolij Gustschin

On 11/25/2011 11:15 AM, Arnd Bergmann wrote:
> On Friday 25 November 2011, Lars-Peter Clausen wrote:
>> On 11/25/2011 05:14 AM, Axel Lin wrote:
>>> This patch converts the drivers in drivers/misc/* to use the
>>> module_i2c_driver() macro which makes the code smaller and a bit
>>> simpler.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
>> I think we should wait with spi and i2c patches until the macro can actually
>> be found in respective subsystem tree. Or do you want these patches to go
>> through GregKH's driver-core tree?
> 
> Obviously it can only go in after the patches introducing the macros.
> Since Greg owns both the char-misc and driver-core trees, there should
> be no problem coordinating between the two.
> 
Yes, but a similar patch has been send out for of a bunch of other trees.
And the commit message does not state that there is a dependency on not yet
applied patches and neither where to get them.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
  2011-11-25 10:40     ` Lars-Peter Clausen
@ 2011-11-25 13:58       ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2011-11-25 13:58 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Axel Lin, linux-kernel, Michael Hennerich, Anantha Narayanan,
	Samu Onkalo, Hemanth V, Christoph Mair, Grant Likely,
	Ben Gardner, Minkyu Kang, Kalhan Trisal, Darrick J. Wong,
	Daniel Mack, Rodolfo Giometti, Greg Kroah-Hartman, Eric Piel,
	Anatolij Gustschin

On Friday 25 November 2011, Lars-Peter Clausen wrote:
> > Obviously it can only go in after the patches introducing the macros.
> > Since Greg owns both the char-misc and driver-core trees, there should
> > be no problem coordinating between the two.
> > 
> Yes, but a similar patch has been send out for of a bunch of other trees.
> And the commit message does not state that there is a dependency on not yet
> applied patches and neither where to get them.

Yes, good point. That should probably be mentioned so people don't just
apply the patches and find out the hard way that they don't work.

	Arnd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
  2011-11-25  4:14 [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Axel Lin
  2011-11-25  4:16 ` [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver() Axel Lin
  2011-11-25  8:30 ` [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Lars-Peter Clausen
@ 2011-11-27  4:16 ` Greg KH
  2011-11-27 12:01   ` Axel Lin
  2 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2011-11-27  4:16 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Michael Hennerich, Anantha Narayanan, Samu Onkalo,
	Hemanth V, Christoph Mair, Grant Likely, Ben Gardner,
	Minkyu Kang, Kalhan Trisal, Darrick J. Wong, Daniel Mack,
	Rodolfo Giometti, Arnd Bergmann, Eric Piel, Anatolij Gustschin

On Fri, Nov 25, 2011 at 12:14:07PM +0800, Axel Lin wrote:
> This patch converts the drivers in drivers/misc/* to use the
> module_i2c_driver() macro which makes the code smaller and a bit
> simpler.

Can you hang on to these patches until after 3.3-rc1 is out and the
macros are in Linus's tree?  That way the cross-tree dependancy will not
be there and all of the individual subsystem maintainers can apply
things without having any problems.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver()
  2011-11-27  4:16 ` Greg KH
@ 2011-11-27 12:01   ` Axel Lin
  0 siblings, 0 replies; 9+ messages in thread
From: Axel Lin @ 2011-11-27 12:01 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Michael Hennerich, Anantha Narayanan, Samu Onkalo,
	Hemanth V, Christoph Mair, Grant Likely, Ben Gardner,
	Minkyu Kang, Kalhan Trisal, Darrick J. Wong, Daniel Mack,
	Rodolfo Giometti, Arnd Bergmann, Eric Piel, Anatolij Gustschin

2011/11/27 Greg KH <greg@kroah.com>:
> On Fri, Nov 25, 2011 at 12:14:07PM +0800, Axel Lin wrote:
>> This patch converts the drivers in drivers/misc/* to use the
>> module_i2c_driver() macro which makes the code smaller and a bit
>> simpler.
>
> Can you hang on to these patches until after 3.3-rc1 is out and the
> macros are in Linus's tree?  That way the cross-tree dependancy will not
> be there and all of the individual subsystem maintainers can apply
> things without having any problems.
Ok.
I didn't know that module_i2c_driver is not in Linus's tree when I
generated the patch against linux-next.
I'll resend the patch after module_i2c_driver is merged to Linus's tree.
Pls ignore this patch now.

Thanks,
Axel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-11-27 12:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-25  4:14 [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Axel Lin
2011-11-25  4:16 ` [PATCH 2/2] MISC: convert drivers/misc/* to use module_spi_driver() Axel Lin
2011-11-25  7:51   ` Michael Hennerich
2011-11-25  8:30 ` [PATCH 1/2] MISC: convert drivers/misc/* to use module_i2c_driver() Lars-Peter Clausen
2011-11-25 10:15   ` Arnd Bergmann
2011-11-25 10:40     ` Lars-Peter Clausen
2011-11-25 13:58       ` Arnd Bergmann
2011-11-27  4:16 ` Greg KH
2011-11-27 12:01   ` Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).