From 7da4f4d9cdce4a3d7e8a54d8a626aa8fc200ac73 Mon Sep 17 00:00:00 2001 From: Audun Korneliussen Date: Wed, 23 Oct 2024 08:44:58 +0200 Subject: [PATCH] driver: regulator: npm1300: fix build warning regulator_npm1300_init() generated uninitialized variable warning. Fix this by being consistent in the error checking in underlying function. Signed-off-by: Audun Korneliussen --- drivers/regulator/regulator_npm1300.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/regulator_npm1300.c b/drivers/regulator/regulator_npm1300.c index 8adb2d3cb81..da0a3aedb64 100644 --- a/drivers/regulator/regulator_npm1300.c +++ b/drivers/regulator/regulator_npm1300.c @@ -533,7 +533,7 @@ static int get_enabled_reg(const struct device *dev, uint8_t base, uint8_t offse int ret = mfd_npm1300_reg_read(config->mfd, base, offset, &data); - if (ret != 0) { + if (ret < 0) { return ret; }