Commit f7fb862b843269d02a2fa75e4bbb49603f801b88

Authored by Wei Yongjun
Committed by Benjamin Herrenschmidt
1 parent 0dc3289c79

powerpc/windfarm: Use module_i2c_driver to simplify the code

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Showing 4 changed files with 4 additions and 50 deletions Side-by-side Diff

drivers/macintosh/windfarm_fcu_controls.c
... ... @@ -593,19 +593,7 @@
593 593 .id_table = wf_fcu_id,
594 594 };
595 595  
596   -static int __init wf_fcu_init(void)
597   -{
598   - return i2c_add_driver(&wf_fcu_driver);
599   -}
600   -
601   -static void __exit wf_fcu_exit(void)
602   -{
603   - i2c_del_driver(&wf_fcu_driver);
604   -}
605   -
606   -
607   -module_init(wf_fcu_init);
608   -module_exit(wf_fcu_exit);
  596 +module_i2c_driver(wf_fcu_driver);
609 597  
610 598 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
611 599 MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control");
drivers/macintosh/windfarm_lm75_sensor.c
... ... @@ -174,19 +174,7 @@
174 174 .id_table = wf_lm75_id,
175 175 };
176 176  
177   -static int __init wf_lm75_sensor_init(void)
178   -{
179   - return i2c_add_driver(&wf_lm75_driver);
180   -}
181   -
182   -static void __exit wf_lm75_sensor_exit(void)
183   -{
184   - i2c_del_driver(&wf_lm75_driver);
185   -}
186   -
187   -
188   -module_init(wf_lm75_sensor_init);
189   -module_exit(wf_lm75_sensor_exit);
  177 +module_i2c_driver(wf_lm75_driver);
190 178  
191 179 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
192 180 MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control");
drivers/macintosh/windfarm_max6690_sensor.c
... ... @@ -130,18 +130,7 @@
130 130 .id_table = wf_max6690_id,
131 131 };
132 132  
133   -static int __init wf_max6690_sensor_init(void)
134   -{
135   - return i2c_add_driver(&wf_max6690_driver);
136   -}
137   -
138   -static void __exit wf_max6690_sensor_exit(void)
139   -{
140   - i2c_del_driver(&wf_max6690_driver);
141   -}
142   -
143   -module_init(wf_max6690_sensor_init);
144   -module_exit(wf_max6690_sensor_exit);
  133 +module_i2c_driver(wf_max6690_driver);
145 134  
146 135 MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>");
147 136 MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control");
drivers/macintosh/windfarm_smu_sat.c
... ... @@ -364,18 +364,7 @@
364 364 .id_table = wf_sat_id,
365 365 };
366 366  
367   -static int __init sat_sensors_init(void)
368   -{
369   - return i2c_add_driver(&wf_sat_driver);
370   -}
371   -
372   -static void __exit sat_sensors_exit(void)
373   -{
374   - i2c_del_driver(&wf_sat_driver);
375   -}
376   -
377   -module_init(sat_sensors_init);
378   -module_exit(sat_sensors_exit);
  367 +module_i2c_driver(wf_sat_driver);
379 368  
380 369 MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>");
381 370 MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control");