[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221215164140.821796-1-arnd@kernel.org>
Date: Thu, 15 Dec 2022 17:41:28 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Tony Lindgren <tony@...mide.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jerome Neanne <jneanne@...libre.com>
Cc: Arnd Bergmann <arnd@...db.de>, Axel Lin <axel.lin@...ics.com>,
Yang Li <yang.lee@...ux.alibaba.com>,
Yang Yingliang <yangyingliang@...wei.com>,
linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] regulator: tps65219: fix Wextra warning
From: Arnd Bergmann <arnd@...db.de>
gcc warns about an invalid pointer comparison when building with
-Wextra enabled:
drivers/regulator/tps65219-regulator.c: In function 'tps65219_regulator_probe':
drivers/regulator/tps65219-regulator.c:370:26: error: ordered comparison of pointer with integer zero [-Werror=extra]
370 | if (rdev < 0) {
| ^
It appears that the intention here was to check for an error code, rather
than the pointer, so adapt the code to propagate the error from the
called function instead.
Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/regulator/tps65219-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c
index c484c943e467..fea3998334b1 100644
--- a/drivers/regulator/tps65219-regulator.c
+++ b/drivers/regulator/tps65219-regulator.c
@@ -366,11 +366,11 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
irq_data[i].dev = tps->dev;
irq_data[i].type = irq_type;
- tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
- if (rdev < 0) {
+ error = tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
+ if (error) {
dev_err(tps->dev, "Failed to get rdev for %s\n",
irq_type->regulator_name);
- return -EINVAL;
+ return error;
}
irq_data[i].rdev = rdev;
--
2.35.1
Powered by blists - more mailing lists