* [PATCH] hwmon: ina2xx: use module_i2c_driver to simplify the code
@ 2012-10-08 12:40 Wei Yongjun
2012-10-08 15:36 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-10-08 12:40 UTC (permalink / raw)
To: khali, linux; +Cc: yongjun_wei, lm-sensors, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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>
---
drivers/hwmon/ina2xx.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index 70717d4..3e7a869 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -301,19 +301,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 <l-felten@ti.com>");
MODULE_DESCRIPTION("ina2xx driver");
MODULE_LICENSE("GPL");
-
-module_init(ina2xx_init);
-module_exit(ina2xx_exit);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-08 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-08 12:40 [PATCH] hwmon: ina2xx: use module_i2c_driver to simplify the code Wei Yongjun
2012-10-08 15:36 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®