mfd: menelaus: Use module_i2c_driver
authorSachin Kamat <sachin.kamat@linaro.org>
Thu, 29 May 2014 11:43:22 +0000 (17:13 +0530)
committerLee Jones <lee.jones@linaro.org>
Tue, 3 Jun 2014 07:12:47 +0000 (08:12 +0100)
module_i2c_driver simplifies the code by eliminating
boilerplate code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/menelaus.c

index ad25bfa..5e2667a 100644 (file)
@@ -1287,29 +1287,8 @@ static struct i2c_driver menelaus_i2c_driver = {
        .id_table       = menelaus_id,
 };
 
-static int __init menelaus_init(void)
-{
-       int res;
-
-       res = i2c_add_driver(&menelaus_i2c_driver);
-       if (res < 0) {
-               pr_err(DRIVER_NAME ": driver registration failed\n");
-               return res;
-       }
-
-       return 0;
-}
-
-static void __exit menelaus_exit(void)
-{
-       i2c_del_driver(&menelaus_i2c_driver);
-
-       /* FIXME: Shutdown menelaus parts that can be shut down */
-}
+module_i2c_driver(menelaus_i2c_driver);
 
 MODULE_AUTHOR("Texas Instruments, Inc. (and others)");
 MODULE_DESCRIPTION("I2C interface for Menelaus.");
 MODULE_LICENSE("GPL");
-
-module_init(menelaus_init);
-module_exit(menelaus_exit);