* [PATCH] power: supply: qcom_battmgr: return charge threshold write errors
@ 2026-11-13 22:17 Hungyu Lin
0 siblings, 0 replies; only message in thread
From: Hungyu Lin @ 2026-11-13 22:17 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Fenglin Wu, linux-pm, linux-arm-msm, linux-kernel, stable
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.
Fixes: cc3e883a0625 ("power: supply: qcom_battmgr: Add charge control support")
Cc: stable@vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
drivers/power/supply/qcom_battmgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index 636d6f6acecc..f14d731e0283 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-13 22:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 22:17 [PATCH] power: supply: qcom_battmgr: return charge threshold write errors Hungyu Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®