mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
power: supply: charger-manager: fix incorrect health status
cm->emergency_stop will only be the value in the enumeration, and cannot be less than zero, it will get an exception value. So replace it with the corresponding value. Signed-off-by: Junlin Yang <yangjunlin@yulong.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
b7e15bd0c1
commit
95b78d5370
@ -723,9 +723,9 @@ static int charger_get_property(struct power_supply *psy,
|
||||
val->intval = cm->battery_status;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_HEALTH:
|
||||
if (cm->emergency_stop > 0)
|
||||
if (cm->emergency_stop == CM_BATT_OVERHEAT)
|
||||
val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
|
||||
else if (cm->emergency_stop < 0)
|
||||
else if (cm->emergency_stop == CM_BATT_COLD)
|
||||
val->intval = POWER_SUPPLY_HEALTH_COLD;
|
||||
else
|
||||
val->intval = POWER_SUPPLY_HEALTH_GOOD;
|
||||
|
Loading…
Reference in New Issue
Block a user