From: Wei Yongjun Date: Sat, 27 Aug 2022 07:32:24 +0000 (+0000) Subject: power: supply: adp5061: show unknown capacity_level as text X-Git-Tag: v6.1~403^2~14 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e568252d722d70bcb3e903477e46f5024138f8ca;p=mirror_ubuntu-kernels.git power: supply: adp5061: show unknown capacity_level as text adp5061_get_battery_status() only defined show chg_status <= 4, others will be show as '-1731902199' from /sys/class/power_supply/xx/capacity_level. switch to show them as 'Unknown'. Signed-off-by: Wei Yongjun Acked-by: Michael Hennerich Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/adp5061.c b/drivers/power/supply/adp5061.c index daee1161c305..fcf8ff0bc974 100644 --- a/drivers/power/supply/adp5061.c +++ b/drivers/power/supply/adp5061.c @@ -493,6 +493,9 @@ static int adp5061_get_battery_status(struct adp5061_state *st, case 0x4: /* VBAT_SNS > VWEAK */ val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL; break; + default: + val->intval = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN; + break; } return ret;