Commit a64fe2ed76614d37abb6966a67f4f39d10efba3c
Committed by
Greg Kroah-Hartman
1 parent
b00e126ffe
Exists in
master
and in
20 other branches
MISC: convert drivers/misc/* to use module_i2c_driver()
This patch converts the drivers in drivers/misc/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Cc: Anantha Narayanan <Anantha.Narayanan@intel.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> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 16 changed files with 17 additions and 194 deletions Side-by-side Diff
- drivers/misc/ad525x_dpot-i2c.c
- drivers/misc/apds9802als.c
- drivers/misc/apds990x.c
- drivers/misc/bh1770glc.c
- drivers/misc/bh1780gli.c
- drivers/misc/bmp085.c
- drivers/misc/ds1682.c
- drivers/misc/eeprom/eeprom.c
- drivers/misc/eeprom/max6875.c
- drivers/misc/fsa9480.c
- drivers/misc/hmc6352.c
- drivers/misc/ics932s401.c
- drivers/misc/isl29003.c
- drivers/misc/isl29020.c
- drivers/misc/lis3lv02d/lis3lv02d_i2c.c
- drivers/misc/tsl2550.c
drivers/misc/ad525x_dpot-i2c.c
... | ... | @@ -113,17 +113,7 @@ |
113 | 113 | .id_table = ad_dpot_id, |
114 | 114 | }; |
115 | 115 | |
116 | -static int __init ad_dpot_i2c_init(void) | |
117 | -{ | |
118 | - return i2c_add_driver(&ad_dpot_i2c_driver); | |
119 | -} | |
120 | -module_init(ad_dpot_i2c_init); | |
121 | - | |
122 | -static void __exit ad_dpot_i2c_exit(void) | |
123 | -{ | |
124 | - i2c_del_driver(&ad_dpot_i2c_driver); | |
125 | -} | |
126 | -module_exit(ad_dpot_i2c_exit); | |
116 | +module_i2c_driver(ad_dpot_i2c_driver); | |
127 | 117 | |
128 | 118 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
129 | 119 | MODULE_DESCRIPTION("digital potentiometer I2C bus driver"); |
drivers/misc/apds9802als.c
... | ... | @@ -332,17 +332,7 @@ |
332 | 332 | .id_table = apds9802als_id, |
333 | 333 | }; |
334 | 334 | |
335 | -static int __init sensor_apds9802als_init(void) | |
336 | -{ | |
337 | - return i2c_add_driver(&apds9802als_driver); | |
338 | -} | |
339 | - | |
340 | -static void __exit sensor_apds9802als_exit(void) | |
341 | -{ | |
342 | - i2c_del_driver(&apds9802als_driver); | |
343 | -} | |
344 | -module_init(sensor_apds9802als_init); | |
345 | -module_exit(sensor_apds9802als_exit); | |
335 | +module_i2c_driver(apds9802als_driver); | |
346 | 336 | |
347 | 337 | MODULE_AUTHOR("Anantha Narayanan <Anantha.Narayanan@intel.com"); |
348 | 338 | MODULE_DESCRIPTION("Avago apds9802als ALS Driver"); |
drivers/misc/apds990x.c
... | ... | @@ -1279,20 +1279,9 @@ |
1279 | 1279 | .id_table = apds990x_id, |
1280 | 1280 | }; |
1281 | 1281 | |
1282 | -static int __init apds990x_init(void) | |
1283 | -{ | |
1284 | - return i2c_add_driver(&apds990x_driver); | |
1285 | -} | |
1282 | +module_i2c_driver(apds990x_driver); | |
1286 | 1283 | |
1287 | -static void __exit apds990x_exit(void) | |
1288 | -{ | |
1289 | - i2c_del_driver(&apds990x_driver); | |
1290 | -} | |
1291 | - | |
1292 | 1284 | MODULE_DESCRIPTION("APDS990X combined ALS and proximity sensor"); |
1293 | 1285 | MODULE_AUTHOR("Samu Onkalo, Nokia Corporation"); |
1294 | 1286 | MODULE_LICENSE("GPL v2"); |
1295 | - | |
1296 | -module_init(apds990x_init); | |
1297 | -module_exit(apds990x_exit); |
drivers/misc/bh1770glc.c
... | ... | @@ -1399,20 +1399,9 @@ |
1399 | 1399 | .id_table = bh1770_id, |
1400 | 1400 | }; |
1401 | 1401 | |
1402 | -static int __init bh1770_init(void) | |
1403 | -{ | |
1404 | - return i2c_add_driver(&bh1770_driver); | |
1405 | -} | |
1402 | +module_i2c_driver(bh1770_driver); | |
1406 | 1403 | |
1407 | -static void __exit bh1770_exit(void) | |
1408 | -{ | |
1409 | - i2c_del_driver(&bh1770_driver); | |
1410 | -} | |
1411 | - | |
1412 | 1404 | MODULE_DESCRIPTION("BH1770GLC / SFH7770 combined ALS and proximity sensor"); |
1413 | 1405 | MODULE_AUTHOR("Samu Onkalo, Nokia Corporation"); |
1414 | 1406 | MODULE_LICENSE("GPL v2"); |
1415 | - | |
1416 | -module_init(bh1770_init); | |
1417 | -module_exit(bh1770_exit); |
drivers/misc/bh1780gli.c
... | ... | @@ -253,21 +253,10 @@ |
253 | 253 | .driver = { |
254 | 254 | .name = "bh1780", |
255 | 255 | .pm = BH1780_PMOPS, |
256 | -}, | |
256 | + }, | |
257 | 257 | }; |
258 | 258 | |
259 | -static int __init bh1780_init(void) | |
260 | -{ | |
261 | - return i2c_add_driver(&bh1780_driver); | |
262 | -} | |
263 | - | |
264 | -static void __exit bh1780_exit(void) | |
265 | -{ | |
266 | - i2c_del_driver(&bh1780_driver); | |
267 | -} | |
268 | - | |
269 | -module_init(bh1780_init) | |
270 | -module_exit(bh1780_exit) | |
259 | +module_i2c_driver(bh1780_driver); | |
271 | 260 | |
272 | 261 | MODULE_DESCRIPTION("BH1780GLI Ambient Light Sensor Driver"); |
273 | 262 | MODULE_LICENSE("GPL"); |
drivers/misc/bmp085.c
... | ... | @@ -464,21 +464,9 @@ |
464 | 464 | .address_list = normal_i2c |
465 | 465 | }; |
466 | 466 | |
467 | -static int __init bmp085_init(void) | |
468 | -{ | |
469 | - return i2c_add_driver(&bmp085_driver); | |
470 | -} | |
467 | +module_i2c_driver(bmp085_driver); | |
471 | 468 | |
472 | -static void __exit bmp085_exit(void) | |
473 | -{ | |
474 | - i2c_del_driver(&bmp085_driver); | |
475 | -} | |
476 | - | |
477 | - | |
478 | 469 | MODULE_AUTHOR("Christoph Mair <christoph.mair@gmail.com"); |
479 | 470 | MODULE_DESCRIPTION("BMP085 driver"); |
480 | 471 | MODULE_LICENSE("GPL"); |
481 | - | |
482 | -module_init(bmp085_init); | |
483 | -module_exit(bmp085_exit); |
drivers/misc/ds1682.c
... | ... | @@ -250,20 +250,9 @@ |
250 | 250 | .id_table = ds1682_id, |
251 | 251 | }; |
252 | 252 | |
253 | -static int __init ds1682_init(void) | |
254 | -{ | |
255 | - return i2c_add_driver(&ds1682_driver); | |
256 | -} | |
253 | +module_i2c_driver(ds1682_driver); | |
257 | 254 | |
258 | -static void __exit ds1682_exit(void) | |
259 | -{ | |
260 | - i2c_del_driver(&ds1682_driver); | |
261 | -} | |
262 | - | |
263 | 255 | MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>"); |
264 | 256 | MODULE_DESCRIPTION("DS1682 Elapsed Time Indicator driver"); |
265 | 257 | MODULE_LICENSE("GPL"); |
266 | - | |
267 | -module_init(ds1682_init); | |
268 | -module_exit(ds1682_exit); |
drivers/misc/eeprom/eeprom.c
... | ... | @@ -229,23 +229,11 @@ |
229 | 229 | .address_list = normal_i2c, |
230 | 230 | }; |
231 | 231 | |
232 | -static int __init eeprom_init(void) | |
233 | -{ | |
234 | - return i2c_add_driver(&eeprom_driver); | |
235 | -} | |
232 | +module_i2c_driver(eeprom_driver); | |
236 | 233 | |
237 | -static void __exit eeprom_exit(void) | |
238 | -{ | |
239 | - i2c_del_driver(&eeprom_driver); | |
240 | -} | |
241 | - | |
242 | - | |
243 | 234 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and " |
244 | 235 | "Philip Edelbrock <phil@netroedge.com> and " |
245 | 236 | "Greg Kroah-Hartman <greg@kroah.com>"); |
246 | 237 | MODULE_DESCRIPTION("I2C EEPROM driver"); |
247 | 238 | MODULE_LICENSE("GPL"); |
248 | - | |
249 | -module_init(eeprom_init); | |
250 | -module_exit(eeprom_exit); |
drivers/misc/eeprom/max6875.c
... | ... | @@ -208,21 +208,9 @@ |
208 | 208 | .id_table = max6875_id, |
209 | 209 | }; |
210 | 210 | |
211 | -static int __init max6875_init(void) | |
212 | -{ | |
213 | - return i2c_add_driver(&max6875_driver); | |
214 | -} | |
211 | +module_i2c_driver(max6875_driver); | |
215 | 212 | |
216 | -static void __exit max6875_exit(void) | |
217 | -{ | |
218 | - i2c_del_driver(&max6875_driver); | |
219 | -} | |
220 | - | |
221 | - | |
222 | 213 | MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>"); |
223 | 214 | MODULE_DESCRIPTION("MAX6875 driver"); |
224 | 215 | MODULE_LICENSE("GPL"); |
225 | - | |
226 | -module_init(max6875_init); | |
227 | -module_exit(max6875_exit); |
drivers/misc/fsa9480.c
... | ... | @@ -541,17 +541,7 @@ |
541 | 541 | .id_table = fsa9480_id, |
542 | 542 | }; |
543 | 543 | |
544 | -static int __init fsa9480_init(void) | |
545 | -{ | |
546 | - return i2c_add_driver(&fsa9480_i2c_driver); | |
547 | -} | |
548 | -module_init(fsa9480_init); | |
549 | - | |
550 | -static void __exit fsa9480_exit(void) | |
551 | -{ | |
552 | - i2c_del_driver(&fsa9480_i2c_driver); | |
553 | -} | |
554 | -module_exit(fsa9480_exit); | |
544 | +module_i2c_driver(fsa9480_i2c_driver); | |
555 | 545 | |
556 | 546 | MODULE_AUTHOR("Minkyu Kang <mk7.kang@samsung.com>"); |
557 | 547 | MODULE_DESCRIPTION("FSA9480 USB Switch driver"); |
drivers/misc/hmc6352.c
... | ... | @@ -148,18 +148,7 @@ |
148 | 148 | .id_table = hmc6352_id, |
149 | 149 | }; |
150 | 150 | |
151 | -static int __init sensor_hmc6352_init(void) | |
152 | -{ | |
153 | - return i2c_add_driver(&hmc6352_driver); | |
154 | -} | |
155 | - | |
156 | -static void __exit sensor_hmc6352_exit(void) | |
157 | -{ | |
158 | - i2c_del_driver(&hmc6352_driver); | |
159 | -} | |
160 | - | |
161 | -module_init(sensor_hmc6352_init); | |
162 | -module_exit(sensor_hmc6352_exit); | |
151 | +module_i2c_driver(hmc6352_driver); | |
163 | 152 | |
164 | 153 | MODULE_AUTHOR("Kalhan Trisal <kalhan.trisal@intel.com"); |
165 | 154 | MODULE_DESCRIPTION("hmc6352 Compass Driver"); |
drivers/misc/ics932s401.c
... | ... | @@ -480,22 +480,11 @@ |
480 | 480 | return 0; |
481 | 481 | } |
482 | 482 | |
483 | -static int __init ics932s401_init(void) | |
484 | -{ | |
485 | - return i2c_add_driver(&ics932s401_driver); | |
486 | -} | |
483 | +module_i2c_driver(ics932s401_driver); | |
487 | 484 | |
488 | -static void __exit ics932s401_exit(void) | |
489 | -{ | |
490 | - i2c_del_driver(&ics932s401_driver); | |
491 | -} | |
492 | - | |
493 | 485 | MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>"); |
494 | 486 | MODULE_DESCRIPTION("ICS932S401 driver"); |
495 | 487 | MODULE_LICENSE("GPL"); |
496 | - | |
497 | -module_init(ics932s401_init); | |
498 | -module_exit(ics932s401_exit); | |
499 | 488 | |
500 | 489 | /* IBM IntelliStation Z30 */ |
501 | 490 | MODULE_ALIAS("dmi:bvnIBM:*:rn9228:*"); |
drivers/misc/isl29003.c
... | ... | @@ -455,21 +455,10 @@ |
455 | 455 | .id_table = isl29003_id, |
456 | 456 | }; |
457 | 457 | |
458 | -static int __init isl29003_init(void) | |
459 | -{ | |
460 | - return i2c_add_driver(&isl29003_driver); | |
461 | -} | |
458 | +module_i2c_driver(isl29003_driver); | |
462 | 459 | |
463 | -static void __exit isl29003_exit(void) | |
464 | -{ | |
465 | - i2c_del_driver(&isl29003_driver); | |
466 | -} | |
467 | - | |
468 | 460 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
469 | 461 | MODULE_DESCRIPTION("ISL29003 ambient light sensor driver"); |
470 | 462 | MODULE_LICENSE("GPL v2"); |
471 | 463 | MODULE_VERSION(DRIVER_VERSION); |
472 | - | |
473 | -module_init(isl29003_init); | |
474 | -module_exit(isl29003_exit); |
drivers/misc/isl29020.c
... | ... | @@ -230,18 +230,7 @@ |
230 | 230 | .id_table = isl29020_id, |
231 | 231 | }; |
232 | 232 | |
233 | -static int __init sensor_isl29020_init(void) | |
234 | -{ | |
235 | - return i2c_add_driver(&isl29020_driver); | |
236 | -} | |
237 | - | |
238 | -static void __exit sensor_isl29020_exit(void) | |
239 | -{ | |
240 | - i2c_del_driver(&isl29020_driver); | |
241 | -} | |
242 | - | |
243 | -module_init(sensor_isl29020_init); | |
244 | -module_exit(sensor_isl29020_exit); | |
233 | +module_i2c_driver(isl29020_driver); | |
245 | 234 | |
246 | 235 | MODULE_AUTHOR("Kalhan Trisal <kalhan.trisal@intel.com>"); |
247 | 236 | MODULE_DESCRIPTION("Intersil isl29020 ALS Driver"); |
drivers/misc/lis3lv02d/lis3lv02d_i2c.c
... | ... | @@ -256,20 +256,9 @@ |
256 | 256 | .id_table = lis3lv02d_id, |
257 | 257 | }; |
258 | 258 | |
259 | -static int __init lis3lv02d_init(void) | |
260 | -{ | |
261 | - return i2c_add_driver(&lis3lv02d_i2c_driver); | |
262 | -} | |
259 | +module_i2c_driver(lis3lv02d_i2c_driver); | |
263 | 260 | |
264 | -static void __exit lis3lv02d_exit(void) | |
265 | -{ | |
266 | - i2c_del_driver(&lis3lv02d_i2c_driver); | |
267 | -} | |
268 | - | |
269 | 261 | MODULE_AUTHOR("Nokia Corporation"); |
270 | 262 | MODULE_DESCRIPTION("lis3lv02d I2C interface"); |
271 | 263 | MODULE_LICENSE("GPL"); |
272 | - | |
273 | -module_init(lis3lv02d_init); | |
274 | -module_exit(lis3lv02d_exit); |
drivers/misc/tsl2550.c
... | ... | @@ -454,21 +454,10 @@ |
454 | 454 | .id_table = tsl2550_id, |
455 | 455 | }; |
456 | 456 | |
457 | -static int __init tsl2550_init(void) | |
458 | -{ | |
459 | - return i2c_add_driver(&tsl2550_driver); | |
460 | -} | |
457 | +module_i2c_driver(tsl2550_driver); | |
461 | 458 | |
462 | -static void __exit tsl2550_exit(void) | |
463 | -{ | |
464 | - i2c_del_driver(&tsl2550_driver); | |
465 | -} | |
466 | - | |
467 | 459 | MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>"); |
468 | 460 | MODULE_DESCRIPTION("TSL2550 ambient light sensor driver"); |
469 | 461 | MODULE_LICENSE("GPL"); |
470 | 462 | MODULE_VERSION(DRIVER_VERSION); |
471 | - | |
472 | -module_init(tsl2550_init); | |
473 | -module_exit(tsl2550_exit); |