hwmon: convert drivers/hwmon/* to use module_i2c_driver()
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>
This commit is contained in:
@@ -261,28 +261,7 @@ static struct i2c_driver sht21_driver = {
|
||||
.id_table = sht21_id,
|
||||
};
|
||||
|
||||
/**
|
||||
* sht21_init() - initialize driver
|
||||
*
|
||||
* Called when kernel is booted or module is inserted.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
static int __init sht21_init(void)
|
||||
{
|
||||
return i2c_add_driver(&sht21_driver);
|
||||
}
|
||||
module_init(sht21_init);
|
||||
|
||||
/**
|
||||
* sht21_init() - clean up driver
|
||||
*
|
||||
* Called when module is removed.
|
||||
*/
|
||||
static void __exit sht21_exit(void)
|
||||
{
|
||||
i2c_del_driver(&sht21_driver);
|
||||
}
|
||||
module_exit(sht21_exit);
|
||||
module_i2c_driver(sht21_driver);
|
||||
|
||||
MODULE_AUTHOR("Urs Fleisch <urs.fleisch@sensirion.com>");
|
||||
MODULE_DESCRIPTION("Sensirion SHT21 humidity and temperature sensor driver");
|
||||
|
Reference in New Issue
Block a user