bq2415x_charger: Use module_i2c_driver
authorSachin Kamat <sachin.kamat@linaro.org>
Tue, 27 Nov 2012 05:58:45 +0000 (11:28 +0530)
committerAnton Vorontsov <anton@enomsg.org>
Sun, 6 Jan 2013 02:41:01 +0000 (18:41 -0800)
module_i2c_driver() makes the code simpler by eliminating module_init and
module_exit calls.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
drivers/power/bq2415x_charger.c

index 2d1b568b29e323247b833e2345e912c07078a8e1..fa1b2bd7526de19fe2b5768eb74d8e7853f51bbe 100644 (file)
@@ -1651,18 +1651,7 @@ static struct i2c_driver bq2415x_driver = {
        .remove = bq2415x_remove,
        .id_table = bq2415x_i2c_id_table,
 };
-
-static int __init bq2415x_init(void)
-{
-       return i2c_add_driver(&bq2415x_driver);
-}
-module_init(bq2415x_init);
-
-static void __exit bq2415x_exit(void)
-{
-       i2c_del_driver(&bq2415x_driver);
-}
-module_exit(bq2415x_exit);
+module_i2c_driver(bq2415x_driver);
 
 MODULE_AUTHOR("Pali Rohár <pali.rohar@gmail.com>");
 MODULE_DESCRIPTION("bq2415x charger driver");