aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-10-07 23:00:04 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 20:59:30 -0500
commitf7fb862b843269d02a2fa75e4bbb49603f801b88 (patch)
treed3aa21750976a1fe81f0d91e6e1497d540a470a3 /drivers
parent0dc3289c797ef9558af566802429212e0b58a5d9 (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.c14
-rw-r--r--drivers/macintosh/windfarm_lm75_sensor.c14
-rw-r--r--drivers/macintosh/windfarm_max6690_sensor.c13
-rw-r--r--drivers/macintosh/windfarm_smu_sat.c13
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
596static int __init wf_fcu_init(void) 596module_i2c_driver(wf_fcu_driver);
597{
598 return i2c_add_driver(&wf_fcu_driver);
599}
600
601static void __exit wf_fcu_exit(void)
602{
603 i2c_del_driver(&wf_fcu_driver);
604}
605
606
607module_init(wf_fcu_init);
608module_exit(wf_fcu_exit);
609 597
610MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 598MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
611MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); 599MODULE_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
177static int __init wf_lm75_sensor_init(void) 177module_i2c_driver(wf_lm75_driver);
178{
179 return i2c_add_driver(&wf_lm75_driver);
180}
181
182static void __exit wf_lm75_sensor_exit(void)
183{
184 i2c_del_driver(&wf_lm75_driver);
185}
186
187
188module_init(wf_lm75_sensor_init);
189module_exit(wf_lm75_sensor_exit);
190 178
191MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 179MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
192MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control"); 180MODULE_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
133static int __init wf_max6690_sensor_init(void) 133module_i2c_driver(wf_max6690_driver);
134{
135 return i2c_add_driver(&wf_max6690_driver);
136}
137
138static void __exit wf_max6690_sensor_exit(void)
139{
140 i2c_del_driver(&wf_max6690_driver);
141}
142
143module_init(wf_max6690_sensor_init);
144module_exit(wf_max6690_sensor_exit);
145 134
146MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); 135MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>");
147MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control"); 136MODULE_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
367static int __init sat_sensors_init(void) 367module_i2c_driver(wf_sat_driver);
368{
369 return i2c_add_driver(&wf_sat_driver);
370}
371
372static void __exit sat_sensors_exit(void)
373{
374 i2c_del_driver(&wf_sat_driver);
375}
376
377module_init(sat_sensors_init);
378module_exit(sat_sensors_exit);
379 368
380MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); 369MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>");
381MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); 370MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control");