powerpc/windfarm: Use module_i2c_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 8 Oct 2012 03:00:04 +0000 (03:00 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 15 Nov 2012 01:59:30 +0000 (12:59 +1100)
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>
drivers/macintosh/windfarm_fcu_controls.c
drivers/macintosh/windfarm_lm75_sensor.c
drivers/macintosh/windfarm_max6690_sensor.c
drivers/macintosh/windfarm_smu_sat.c

index b3411edb324bea18cfdfbd02f6cedde49bb3bc9c..fd6ed15a979dfae62db35fb2fd7ea3ff4f1c650b 100644 (file)
@@ -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 <benh@kernel.crashing.org>");
 MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control");
index b0c2d3695b347fc1e5c8f16c22527903ecfa1630..9ef32b3df91f060b0b85d399d207faad7c072384 100644 (file)
@@ -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 <benh@kernel.crashing.org>");
 MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control");
index 371b058d2f7d9565a4dada1a8bd99616ec30ec50..945a25b2f31ea78b82a746d6beff6407341e5db4 100644 (file)
@@ -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 <paulus@samba.org>");
 MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control");
index 426e810233d7403595474f2a1e1ffa810daa141f..d87f5ee04ca9b3c1638e99c7a0655256d7fc8e66 100644 (file)
@@ -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 <paulus@samba.org>");
 MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control");