Skip to content

Commit

Permalink
hwmon: convert drivers/hwmon/* to use module_i2c_driver()
Browse files Browse the repository at this point in the history
This patch converts the drivers in drivers/hwmon/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Cc: David George <david.george@ska.ac.za>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
  • Loading branch information
AxelLin authored and Guenter Roeck committed Mar 19, 2012
1 parent 61ba031 commit f0967ee
Show file tree
Hide file tree
Showing 74 changed files with 74 additions and 909 deletions.
12 changes: 1 addition & 11 deletions drivers/hwmon/ad7414.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,7 @@ static struct i2c_driver ad7414_driver = {
.id_table = ad7414_id,
};

static int __init ad7414_init(void)
{
return i2c_add_driver(&ad7414_driver);
}
module_init(ad7414_init);

static void __exit ad7414_exit(void)
{
i2c_del_driver(&ad7414_driver);
}
module_exit(ad7414_exit);
module_i2c_driver(ad7414_driver);

MODULE_AUTHOR("Stefan Roese <sr at denx.de>, "
"Frank Edelhaeuser <frank.edelhaeuser at spansion.com>");
Expand Down
13 changes: 1 addition & 12 deletions drivers/hwmon/ad7418.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,9 @@ static int ad7418_remove(struct i2c_client *client)
return 0;
}

static int __init ad7418_init(void)
{
return i2c_add_driver(&ad7418_driver);
}

static void __exit ad7418_exit(void)
{
i2c_del_driver(&ad7418_driver);
}
module_i2c_driver(ad7418_driver);

MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
MODULE_DESCRIPTION("AD7416/17/18 driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);

module_init(ad7418_init);
module_exit(ad7418_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/adm1021.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,7 @@ static struct adm1021_data *adm1021_update_device(struct device *dev)
return data;
}

static int __init sensors_adm1021_init(void)
{
return i2c_add_driver(&adm1021_driver);
}

static void __exit sensors_adm1021_exit(void)
{
i2c_del_driver(&adm1021_driver);
}
module_i2c_driver(adm1021_driver);

MODULE_AUTHOR ("Frodo Looijaard <frodol@dds.nl> and "
"Philip Edelbrock <phil@netroedge.com>");
Expand All @@ -468,6 +460,3 @@ MODULE_LICENSE("GPL");

module_param(read_only, bool, 0);
MODULE_PARM_DESC(read_only, "Don't set any values, read only mode");

module_init(sensors_adm1021_init)
module_exit(sensors_adm1021_exit)
13 changes: 1 addition & 12 deletions drivers/hwmon/adm1025.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,19 +618,8 @@ static struct adm1025_data *adm1025_update_device(struct device *dev)
return data;
}

static int __init sensors_adm1025_init(void)
{
return i2c_add_driver(&adm1025_driver);
}

static void __exit sensors_adm1025_exit(void)
{
i2c_del_driver(&adm1025_driver);
}
module_i2c_driver(adm1025_driver);

MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
MODULE_DESCRIPTION("ADM1025 driver");
MODULE_LICENSE("GPL");

module_init(sensors_adm1025_init);
module_exit(sensors_adm1025_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/adm1026.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,20 +1761,9 @@ static int adm1026_remove(struct i2c_client *client)
return 0;
}

static int __init sm_adm1026_init(void)
{
return i2c_add_driver(&adm1026_driver);
}

static void __exit sm_adm1026_exit(void)
{
i2c_del_driver(&adm1026_driver);
}
module_i2c_driver(adm1026_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, "
"Justin Thiessen <jthiessen@penguincomputing.com>");
MODULE_DESCRIPTION("ADM1026 driver");

module_init(sm_adm1026_init);
module_exit(sm_adm1026_exit);
18 changes: 1 addition & 17 deletions drivers/hwmon/adm1029.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,24 +450,8 @@ static struct adm1029_data *adm1029_update_device(struct device *dev)
return data;
}

/*
Common module stuff
*/
static int __init sensors_adm1029_init(void)
{

return i2c_add_driver(&adm1029_driver);
}

static void __exit sensors_adm1029_exit(void)
{

i2c_del_driver(&adm1029_driver);
}
module_i2c_driver(adm1029_driver);

MODULE_AUTHOR("Corentin LABBE <corentin.labbe@geomatys.fr>");
MODULE_DESCRIPTION("adm1029 driver");
MODULE_LICENSE("GPL v2");

module_init(sensors_adm1029_init);
module_exit(sensors_adm1029_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/adm1031.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,19 +1131,8 @@ static struct adm1031_data *adm1031_update_device(struct device *dev)
return data;
}

static int __init sensors_adm1031_init(void)
{
return i2c_add_driver(&adm1031_driver);
}

static void __exit sensors_adm1031_exit(void)
{
i2c_del_driver(&adm1031_driver);
}
module_i2c_driver(adm1031_driver);

MODULE_AUTHOR("Alexandre d'Alton <alex@alexdalton.org>");
MODULE_DESCRIPTION("ADM1031/ADM1030 driver");
MODULE_LICENSE("GPL");

module_init(sensors_adm1031_init);
module_exit(sensors_adm1031_exit);
14 changes: 1 addition & 13 deletions drivers/hwmon/adm9240.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,21 +795,9 @@ static struct adm9240_data *adm9240_update_device(struct device *dev)
return data;
}

static int __init sensors_adm9240_init(void)
{
return i2c_add_driver(&adm9240_driver);
}

static void __exit sensors_adm9240_exit(void)
{
i2c_del_driver(&adm9240_driver);
}
module_i2c_driver(adm9240_driver);

MODULE_AUTHOR("Michiel Rook <michiel@grendelproject.nl>, "
"Grant Coady <gcoady.lk@gmail.com> and others");
MODULE_DESCRIPTION("ADM9240/DS1780/LM81 driver");
MODULE_LICENSE("GPL");

module_init(sensors_adm9240_init);
module_exit(sensors_adm9240_exit);

13 changes: 1 addition & 12 deletions drivers/hwmon/ads1015.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,8 @@ static struct i2c_driver ads1015_driver = {
.id_table = ads1015_id,
};

static int __init sensors_ads1015_init(void)
{
return i2c_add_driver(&ads1015_driver);
}

static void __exit sensors_ads1015_exit(void)
{
i2c_del_driver(&ads1015_driver);
}
module_i2c_driver(ads1015_driver);

MODULE_AUTHOR("Dirk Eibach <eibach@gdsys.de>");
MODULE_DESCRIPTION("ADS1015 driver");
MODULE_LICENSE("GPL");

module_init(sensors_ads1015_init);
module_exit(sensors_ads1015_exit);
12 changes: 1 addition & 11 deletions drivers/hwmon/adt7411.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,7 @@ static struct i2c_driver adt7411_driver = {
.class = I2C_CLASS_HWMON,
};

static int __init sensors_adt7411_init(void)
{
return i2c_add_driver(&adt7411_driver);
}
module_init(sensors_adt7411_init)

static void __exit sensors_adt7411_exit(void)
{
i2c_del_driver(&adt7411_driver);
}
module_exit(sensors_adt7411_exit)
module_i2c_driver(adt7411_driver);

MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de> and "
"Wolfram Sang <w.sang@pengutronix.de>");
Expand Down
13 changes: 1 addition & 12 deletions drivers/hwmon/adt7462.c
Original file line number Diff line number Diff line change
Expand Up @@ -1975,19 +1975,8 @@ static int adt7462_remove(struct i2c_client *client)
return 0;
}

static int __init adt7462_init(void)
{
return i2c_add_driver(&adt7462_driver);
}

static void __exit adt7462_exit(void)
{
i2c_del_driver(&adt7462_driver);
}
module_i2c_driver(adt7462_driver);

MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>");
MODULE_DESCRIPTION("ADT7462 driver");
MODULE_LICENSE("GPL");

module_init(adt7462_init);
module_exit(adt7462_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/adt7470.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,19 +1317,8 @@ static int adt7470_remove(struct i2c_client *client)
return 0;
}

static int __init adt7470_init(void)
{
return i2c_add_driver(&adt7470_driver);
}

static void __exit adt7470_exit(void)
{
i2c_del_driver(&adt7470_driver);
}
module_i2c_driver(adt7470_driver);

MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>");
MODULE_DESCRIPTION("ADT7470 driver");
MODULE_LICENSE("GPL");

module_init(adt7470_init);
module_exit(adt7470_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/adt7475.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,19 +1626,8 @@ static struct adt7475_data *adt7475_update_device(struct device *dev)
return data;
}

static int __init sensors_adt7475_init(void)
{
return i2c_add_driver(&adt7475_driver);
}

static void __exit sensors_adt7475_exit(void)
{
i2c_del_driver(&adt7475_driver);
}
module_i2c_driver(adt7475_driver);

MODULE_AUTHOR("Advanced Micro Devices, Inc");
MODULE_DESCRIPTION("adt7475 driver");
MODULE_LICENSE("GPL");

module_init(sensors_adt7475_init);
module_exit(sensors_adt7475_exit);
15 changes: 1 addition & 14 deletions drivers/hwmon/amc6821.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,20 +1095,7 @@ static struct amc6821_data *amc6821_update_device(struct device *dev)
return data;
}


static int __init amc6821_init(void)
{
return i2c_add_driver(&amc6821_driver);
}

static void __exit amc6821_exit(void)
{
i2c_del_driver(&amc6821_driver);
}

module_init(amc6821_init);
module_exit(amc6821_exit);

module_i2c_driver(amc6821_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("T. Mertelj <tomaz.mertelj@guest.arnes.si>");
Expand Down
13 changes: 1 addition & 12 deletions drivers/hwmon/asb100.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,19 +971,8 @@ static struct asb100_data *asb100_update_device(struct device *dev)
return data;
}

static int __init asb100_init(void)
{
return i2c_add_driver(&asb100_driver);
}

static void __exit asb100_exit(void)
{
i2c_del_driver(&asb100_driver);
}
module_i2c_driver(asb100_driver);

MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
MODULE_DESCRIPTION("ASB100 Bach driver");
MODULE_LICENSE("GPL");

module_init(asb100_init);
module_exit(asb100_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/atxp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,4 @@ static int atxp1_remove(struct i2c_client *client)
return 0;
};

static int __init atxp1_init(void)
{
return i2c_add_driver(&atxp1_driver);
};

static void __exit atxp1_exit(void)
{
i2c_del_driver(&atxp1_driver);
};

module_init(atxp1_init);
module_exit(atxp1_exit);
module_i2c_driver(atxp1_driver);
14 changes: 1 addition & 13 deletions drivers/hwmon/ds1621.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,20 +305,8 @@ static struct i2c_driver ds1621_driver = {
.address_list = normal_i2c,
};

static int __init ds1621_init(void)
{
return i2c_add_driver(&ds1621_driver);
}

static void __exit ds1621_exit(void)
{
i2c_del_driver(&ds1621_driver);
}

module_i2c_driver(ds1621_driver);

MODULE_AUTHOR("Christian W. Zuckschwerdt <zany@triq.net>");
MODULE_DESCRIPTION("DS1621 driver");
MODULE_LICENSE("GPL");

module_init(ds1621_init);
module_exit(ds1621_exit);
13 changes: 1 addition & 12 deletions drivers/hwmon/ds620.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,8 @@ static struct i2c_driver ds620_driver = {
.id_table = ds620_id,
};

static int __init ds620_init(void)
{
return i2c_add_driver(&ds620_driver);
}

static void __exit ds620_exit(void)
{
i2c_del_driver(&ds620_driver);
}
module_i2c_driver(ds620_driver);

MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>");
MODULE_DESCRIPTION("DS620 driver");
MODULE_LICENSE("GPL");

module_init(ds620_init);
module_exit(ds620_exit);
Loading

0 comments on commit f0967ee

Please sign in to comment.