diff options
| author | 2026-10-12 22:21:53 -0400 | |
|---|---|---|
| committer | 2026-10-17 23:39:00 +0200 | |
| commit | 8ae5a3f40045ff486826ed6b6a83e39a0f380073 (patch) | |
| tree | 41878242c9c80aded4c0092272383119405d3581 /scripts/Makefile.thinlto | |
| parent | power: supply: qcom_battmgr: report the USB type from USB_ADAP_TYPE (diff) | |
power: supply: generic-adc-battery: fix status with no supplier
power_supply_am_i_supplied() returns -ENODEV when no registered power
supply supplies the battery. generic-adc-battery's gab_work() tests this
return value as a boolean, so -ENODEV takes the supplied branch and
reports CHARGING, or NOT_CHARGING if the charge-finished GPIO is asserted,
instead of DISCHARGING.
This was noticed while bringing up an out-of-tree Linux port to the
WikiReader: the driver reported CHARGING on a device powered by two AAA
batteries with no charging hardware.
Only a positive return value indicates an online supplier, so treat zero
and negative returns as discharging.
Fixes: 46cecd130d55 ("power: supply: Fix power_supply_am_i_supplied to return -ENODEV when apropriate")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Douglas <me@timdoug.com>
Link: https://patch.msgid.link/20261013022153.6707-1-me@timdoug.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
