Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] power: supply: max17042_battery: Fix vmin assigned instead of vmax in DT parsing
@ 2026-09-01  5:36 Xueqin Luo
  2026-09-01  5:41 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Xueqin Luo @ 2026-09-01  5:36 UTC (permalink / raw)
  To: hansg, krzk, m.szyprowski, sebastian.krzyszkowiak, kernel, sre
  Cc: linux-pm, linux-kernel, Xueqin Luo

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@kylinos.cn>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: supply: max17042_battery: Fix vmin assigned instead of vmax in DT parsing
  2026-09-01  5:36 [PATCH] power: supply: max17042_battery: Fix vmin assigned instead of vmax in DT parsing Xueqin Luo
@ 2026-09-01  5:41 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-01  5:41 UTC (permalink / raw)
  To: Xueqin Luo, hansg, m.szyprowski, sebastian.krzyszkowiak, kernel,
	sre
  Cc: linux-pm, linux-kernel

On 01/09/2026 07:36, Xueqin Luo wrote:
> 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@kylinos.cn>
> ---
>  drivers/power/supply/max17042_battery.c | 2 +-


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-01  5:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01  5:36 [PATCH] power: supply: max17042_battery: Fix vmin assigned instead of vmax in DT parsing Xueqin Luo
2026-09-01  5:41 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox