power: supply: qcom_battmgr: return charge threshold write errors
Subsystems (3)
PATCH 1/1 power: supply: qcom_battmgr: return charge threshold write errors
Both charge threshold setters return success even when qcom_battmgr_set_charge_control() fails. If the PMIC GLINK transport returns an error or the firmware does not reply in time, the sysfs write still reports that it consumed the input while the cached thresholds retain their previous values.
Return the request status from both setters so userspace can detect the failed write.
--- drivers/power/supply/qcom_battmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/qcom_battmgr.c +2 -2
@@ -704,7 +704,7 @@ static int qcom_battmgr_set_charge_start_threshold(struct qcom_battmgr *battmgr, battmgr->info.charge_ctrl_end = target_soc; } -return 0 ; +return ret; }static int qcom_battmgr_set_charge_end_threshold (struct qcom_battmgr *battmgr,int end_soc)
@@ -725,7 +725,7 @@ static int qcom_battmgr_set_charge_end_threshold(struct qcom_battmgr *battmgr, i battmgr->info.charge_ctrl_end = end_soc; } -return 0 ; +return ret; }static int qcom_battmgr_charge_control_thresholds_init (struct qcom_battmgr *battmgr)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
Sebastian Reichel
AppliedQuoted 10 lines · Hungyu Lin
Both charge threshold setters return success even when
qcom_battmgr_set_charge_control()fails. If the PMIC GLINK transport returns an error or the firmware does not reply in time, the sysfs write still reports that it consumed the input while the cached thresholds retain their previous values.Return the request status from both setters so userspace can detect the failed write.
[...]
Applied, thanks!
[1/1] power: supply: qcom_battmgr: return charge threshold write errors
commit: ffce9bb777f28733e981928fb19f2d13be40b6b9
Best regards,
Signature · 1 line
Sebastian Reichel <[email protected]>