From f7fb862b843269d02a2fa75e4bbb49603f801b88 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Mon, 8 Oct 2012 03:00:04 +0000 Subject: [PATCH] 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 Signed-off-by: Benjamin Herrenschmidt --- drivers/macintosh/windfarm_fcu_controls.c | 14 +------------- drivers/macintosh/windfarm_lm75_sensor.c | 14 +------------- drivers/macintosh/windfarm_max6690_sensor.c | 13 +------------ 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 = { .id_table = wf_fcu_id, }; -static int __init wf_fcu_init(void) -{ - return i2c_add_driver(&wf_fcu_driver); -} - -static void __exit wf_fcu_exit(void) -{ - i2c_del_driver(&wf_fcu_driver); -} - - -module_init(wf_fcu_init); -module_exit(wf_fcu_exit); +module_i2c_driver(wf_fcu_driver); MODULE_AUTHOR("Benjamin Herrenschmidt "); 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 = { .id_table = wf_lm75_id, }; -static int __init wf_lm75_sensor_init(void) -{ - return i2c_add_driver(&wf_lm75_driver); -} - -static void __exit wf_lm75_sensor_exit(void) -{ - i2c_del_driver(&wf_lm75_driver); -} - - -module_init(wf_lm75_sensor_init); -module_exit(wf_lm75_sensor_exit); +module_i2c_driver(wf_lm75_driver); MODULE_AUTHOR("Benjamin Herrenschmidt "); 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 = { .id_table = wf_max6690_id, }; -static int __init wf_max6690_sensor_init(void) -{ - return i2c_add_driver(&wf_max6690_driver); -} - -static void __exit wf_max6690_sensor_exit(void) -{ - i2c_del_driver(&wf_max6690_driver); -} - -module_init(wf_max6690_sensor_init); -module_exit(wf_max6690_sensor_exit); +module_i2c_driver(wf_max6690_driver); MODULE_AUTHOR("Paul Mackerras "); 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 = { .id_table = wf_sat_id, }; -static int __init sat_sensors_init(void) -{ - return i2c_add_driver(&wf_sat_driver); -} - -static void __exit sat_sensors_exit(void) -{ - i2c_del_driver(&wf_sat_driver); -} - -module_init(sat_sensors_init); -module_exit(sat_sensors_exit); +module_i2c_driver(wf_sat_driver); MODULE_AUTHOR("Paul Mackerras "); MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); -- 2.30.2