From a9466ad0d5fea4b6a9b4aa183a32d6740f698156 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:10:04 +0000 Subject: fix-pcf50633-usbrem-charging-led.patch If the charger was removed, we fell through back to old hdq-driven code with normally wrong but slightly random results for charging LED behaviour in that circumstance This patch makes us use the tracked charger status callbacks alone if they are defined in the platform data. Signed-off-by: Andy Green --- drivers/power/bq27000_battery.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c index 7020608e6e9..4c7e862517f 100644 --- a/drivers/power/bq27000_battery.c +++ b/drivers/power/bq27000_battery.c @@ -182,12 +182,16 @@ static int bq27000_battery_get_property(struct power_supply *psy, */ if (!di->pdata->get_charger_active_status) goto use_bat; - if ((di->pdata->get_charger_active_status)()) + + if ((di->pdata->get_charger_active_status)()) { val->intval = POWER_SUPPLY_STATUS_CHARGING; - else - val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; - break; + break; + } } + + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; + break; + use_bat: /* * either the charger is not connected, or the -- cgit v1.2.3