mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-12 01:20:14 +00:00
power: supply: rt9467: Return error on failure in rt9467_set_value_from_ranges()
The return value of rt9467_set_value_from_ranges() when setting AICL VTH is
not checked, even though it may fail.
Log error and return from rt9467_run_aicl() on fail.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver")
Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
Link: https://patch.msgid.link/20251009144725.562278-1-i.abramov@mt-integration.ru
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
2c68ac48c5
commit
8b27fe2d8d
@ -588,6 +588,10 @@ static int rt9467_run_aicl(struct rt9467_chg_data *data)
|
||||
aicl_vth = mivr_vth + RT9467_AICLVTH_GAP_uV;
|
||||
ret = rt9467_set_value_from_ranges(data, F_AICL_VTH,
|
||||
RT9467_RANGE_AICL_VTH, aicl_vth);
|
||||
if (ret) {
|
||||
dev_err(data->dev, "Failed to set AICL VTH\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Trigger AICL function */
|
||||
ret = regmap_field_write(data->rm_field[F_AICL_MEAS], 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user