From: Laxman Dewangan Date: Thu, 30 May 2013 19:31:00 +0000 (+0530) Subject: power: max17042-battery: initialise fuel gauge driver before charger X-Git-Tag: tegra-l4t-r17-17r1~176 X-Git-Url: https://nv-tegra.nvidia.com/r/gitweb?p=linux-2.6.git;a=commitdiff_plain;h=9a10669af1ea46b1a55d03f47d6c66d835ecc181 power: max17042-battery: initialise fuel gauge driver before charger 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 Reviewed-on: http://git-master/r/234254 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c index a91a2e6bf0f..bc8ec2d690a 100644 --- a/drivers/power/max17042_battery.c +++ b/drivers/power/max17042_battery.c @@ -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 "); MODULE_DESCRIPTION("MAX17042 Fuel Gauge");