diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-07 23:00:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 20:59:30 -0500 |
commit | f7fb862b843269d02a2fa75e4bbb49603f801b88 (patch) | |
tree | d3aa21750976a1fe81f0d91e6e1497d540a470a3 /drivers | |
parent | 0dc3289c797ef9558af566802429212e0b58a5d9 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/macintosh/windfarm_fcu_controls.c | 14 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_lm75_sensor.c | 14 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_max6690_sensor.c | 13 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_smu_sat.c | 13 |
4 files changed, 4 insertions, 50 deletions
diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c index b3411edb324b..fd6ed15a979d 100644 --- a/drivers/macintosh/windfarm_fcu_controls.c +++ b/drivers/macintosh/windfarm_fcu_controls.c | |||
@@ -593,19 +593,7 @@ static struct i2c_driver wf_fcu_driver = { | |||
593 | .id_table = wf_fcu_id, | 593 | .id_table = wf_fcu_id, |
594 | }; | 594 | }; |
595 | 595 | ||
596 | static int __init wf_fcu_init(void) | 596 | module_i2c_driver(wf_fcu_driver); |
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); | ||
609 | 597 | ||
610 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); | 598 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); |
611 | MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); | 599 | MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index b0c2d3695b34..9ef32b3df91f 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
@@ -174,19 +174,7 @@ static struct i2c_driver wf_lm75_driver = { | |||
174 | .id_table = wf_lm75_id, | 174 | .id_table = wf_lm75_id, |
175 | }; | 175 | }; |
176 | 176 | ||
177 | static int __init wf_lm75_sensor_init(void) | 177 | module_i2c_driver(wf_lm75_driver); |
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); | ||
190 | 178 | ||
191 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); | 179 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); |
192 | MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control"); | 180 | MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control"); |
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index 371b058d2f7d..945a25b2f31e 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
@@ -130,18 +130,7 @@ static struct i2c_driver wf_max6690_driver = { | |||
130 | .id_table = wf_max6690_id, | 130 | .id_table = wf_max6690_id, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static int __init wf_max6690_sensor_init(void) | 133 | module_i2c_driver(wf_max6690_driver); |
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); | ||
145 | 134 | ||
146 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); | 135 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); |
147 | MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control"); | 136 | MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control"); |
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 426e810233d7..d87f5ee04ca9 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
@@ -364,18 +364,7 @@ static struct i2c_driver wf_sat_driver = { | |||
364 | .id_table = wf_sat_id, | 364 | .id_table = wf_sat_id, |
365 | }; | 365 | }; |
366 | 366 | ||
367 | static int __init sat_sensors_init(void) | 367 | module_i2c_driver(wf_sat_driver); |
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); | ||
379 | 368 | ||
380 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); | 369 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); |
381 | MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); | 370 | MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); |