[PATCH] power: supply: max17042_battery: Fix vmin assigned instead of vmax in DT parsing

From: Xueqin Luo

Date: Tue Sep 01 2026 - 01:37:13 EST


The else branch of the "maxim,over-volt" property check assigns the
parsed value to chip->vmin instead of chip->vmax, so chip->vmin is
overwritten and chip->vmax never gets the DT value.

Fixes: 6a3b47a5a5fc ("power: supply: Match DT value types")
Signed-off-by: Xueqin Luo <luoxueqin@xxxxxxxxxx>
---
drivers/power/supply/max17042_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index cbf3ac9c3e14..505a68c26463 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -1233,7 +1233,7 @@ static int max17042_parse_dt(struct max17042_chip *chip)
if (of_property_read_u32(np, "maxim,over-volt", &prop))
chip->vmax = INT_MAX;
else
- chip->vmin = prop;
+ chip->vmax = prop;

return 0;
}
--
2.43.0