Re: [PATCH] power: supply: max17040: handle missing status supplier

From: Greg KH

Date: Wed Jul 01 2026 - 01:47:53 EST


On Wed, Jul 01, 2026 at 09:21:01AM +0800, jianing.li wrote:
> MAX17040 does not report charger state itself, so the driver forwards
> POWER_SUPPLY_PROP_STATUS to a supplier power supply. If no supplier is
> registered, power_supply_get_property_from_supplier() returns -ENODEV and
> leaves the output value untouched.
>
> max17040_get_property() currently ignores that error and returns success,
> so userspace can read an uninitialized status value from the battery power
> supply. This happens on systems that use the fuel gauge without a charger
> supplier relationship in firmware.
>
> Return POWER_SUPPLY_STATUS_UNKNOWN when no supplier provides STATUS, and
> propagate other supplier lookup errors.
>
> Fixes: f4b782af61ae ("power: max17040: pass status property from supplier")
> Cc: stable@xxxxxxxxxxxxxxx # 6.7+
> Signed-off-by: jianing.li <m13940358460@xxxxxxx>

Please use your name, not an email alias.

And why send this 3 times?

thanks,

greg k-h