This patch modifies msic_update_disconn_status() signature so that it can take the event as an argument and set the status accordingly instead of getting the status inside the function. msic_batt_disconn function is modified to support this change.
Signed-off-by: Ramakrishna Pallala <[email protected]> --- drivers/power/intel_mdf_battery.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/power/intel_mdf_battery.c b/drivers/power/intel_mdf_battery.c index ed6eff5..baa1917 100644 --- a/drivers/power/intel_mdf_battery.c +++ b/drivers/power/intel_mdf_battery.c @@ -1567,14 +1567,9 @@ static void reset_wdt_timer(struct msic_power_module_info *mbi) msic_write_multi(mbi, address, data, 2); } -static void msic_update_disconn_status(struct msic_power_module_info *mbi) +static void msic_update_disconn_status(struct msic_power_module_info *mbi, + int event) { - int event; - - spin_lock(&mbi->event_lock); - event = mbi->batt_event; - spin_unlock(&mbi->event_lock); - mutex_lock(&mbi->usb_chrg_lock); mbi->usb_chrg_props.charger_health = POWER_SUPPLY_HEALTH_UNKNOWN; memcpy(mbi->usb_chrg_props.charger_model, "Unknown", sizeof("Unknown")); @@ -1898,7 +1893,7 @@ lbl_sched_work: static void msic_batt_disconn(struct work_struct *work) { - int ret; + int ret, event; struct msic_power_module_info *mbi = container_of(work, struct msic_power_module_info, disconn_handler.work); @@ -1907,7 +1902,12 @@ static void msic_batt_disconn(struct work_struct *work) dev_dbg(msic_dev, "%s: failed\n", __func__); return; } - msic_update_disconn_status(mbi); + + spin_lock(&mbi->event_lock); + event = mbi->batt_event; + spin_unlock(&mbi->event_lock); + + msic_update_disconn_status(mbi, event); } /** -- 1.7.2.3
0004-Update-disconnect-status-function-modified.patch
Description: 0004-Update-disconnect-status-function-modified.patch
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
