power: max17042-battery: initialise fuel gauge driver before charger
Laxman Dewangan [Thu, 30 May 2013 19:31:00 +0000 (00:31 +0530)]
As charger driver uses the API from fuel gauge driver, register/initailise
the fuel gauge driver before charger driver.

Change-Id: I61586cf6958f52af282cde080c26ae0992826218
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/234254
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit

drivers/power/max17042_battery.c

index a91a2e6..bc8ec2d 100644 (file)
@@ -942,7 +942,18 @@ static struct i2c_driver max17042_i2c_driver = {
        .id_table       = max17042_id,
        .shutdown       = max17042_shutdown,
 };
-module_i2c_driver(max17042_i2c_driver);
+
+static int __init max17042_init(void)
+{
+       return i2c_add_driver(&max17042_i2c_driver);
+}
+subsys_initcall(max17042_init);
+
+static void __exit max17042_exit(void)
+{
+       i2c_del_driver(&max17042_i2c_driver);
+}
+module_exit(max17042_exit);
 
 MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
 MODULE_DESCRIPTION("MAX17042 Fuel Gauge");