linux-yocto/drivers/power
Charles Han 9ed082a72c power: supply: max14577: Handle NULL pdata when CONFIG_OF is not set
[ Upstream commit 2937f5d2e2 ]

When the kernel is not configured  CONFIG_OF, the max14577_charger_dt_init
function returns NULL. Fix the max14577_charger_probe functionby returning
-ENODATA instead of potentially passing a NULL pointer to PTR_ERR.

This fixes the below smatch warning:
max14577_charger_probe() warn: passing zero to 'PTR_ERR'

Fixes: e30110e9c9 ("charger: max14577: Configure battery-dependent settings from DTS and sysfs")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250519061601.8755-1-hanchunchao@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:24:09 +02:00
..
reset power: reset: at91-reset: Optimize at91_reset() 2025-06-27 11:05:10 +01:00
supply power: supply: max14577: Handle NULL pdata when CONFIG_OF is not set 2025-08-28 16:24:09 +02:00
Kconfig
Makefile