From: Wei Yongjun Date: Mon, 8 Oct 2012 12:40:35 +0000 (+0800) Subject: hwmon: (ina2xx) use module_i2c_driver to simplify the code X-Git-Tag: next-20121115~87^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5ea13592b8b3a9b4d4a550ff518993da30022dfc;p=karo-tx-linux.git hwmon: (ina2xx) 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: Guenter Roeck --- diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 2b726346f8fa..8e7158c3ad2f 100644 --- a/drivers/hwmon/ina2xx.c +++ b/drivers/hwmon/ina2xx.c @@ -302,19 +302,8 @@ static struct i2c_driver ina2xx_driver = { .id_table = ina2xx_id, }; -static int __init ina2xx_init(void) -{ - return i2c_add_driver(&ina2xx_driver); -} - -static void __exit ina2xx_exit(void) -{ - i2c_del_driver(&ina2xx_driver); -} +module_i2c_driver(ina2xx_driver); MODULE_AUTHOR("Lothar Felten "); MODULE_DESCRIPTION("ina2xx driver"); MODULE_LICENSE("GPL"); - -module_init(ina2xx_init); -module_exit(ina2xx_exit);