]> git.karo-electronics.de Git - linux-beck.git/commitdiff
w1/ds2482: use module_i2c_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 8 Oct 2012 14:06:07 +0000 (22:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 22:52:29 +0000 (15:52 -0700)
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>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/ds2482.c

index e5f74416d4b766f6da15dc45ded4042440d7d64e..6429b9e9fb82f94227b2a0dad004dfa342113026 100644 (file)
@@ -505,19 +505,8 @@ static int ds2482_remove(struct i2c_client *client)
        return 0;
 }
 
-static int __init sensors_ds2482_init(void)
-{
-       return i2c_add_driver(&ds2482_driver);
-}
-
-static void __exit sensors_ds2482_exit(void)
-{
-       i2c_del_driver(&ds2482_driver);
-}
+module_i2c_driver(ds2482_driver);
 
 MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");
 MODULE_DESCRIPTION("DS2482 driver");
 MODULE_LICENSE("GPL");
-
-module_init(sensors_ds2482_init);
-module_exit(sensors_ds2482_exit);