Thread (17 messages) 17 messages, 4 authors, 2020-06-26
STALE2222d LANDED

[PATCH 6/9] regulator: tps65217-regulator: Use the returned value of tps65217_reg_read()

From: Lee Jones <hidden>
Date: 2020-06-26 06:57:59
Also in: linux-omap, lkml
Subsystem: omap2+ support, the rest, voltage and current regulator framework · Maintainers: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren, Linus Torvalds, Liam Girdwood, Mark Brown

Until now the aforementioned return value has been ignored.
Previous and current calls to tps65217_reg_read() return
instantly when the value is not 0, so let's do that.

Fixes the following W=1 warning:

 drivers/regulator/tps65217-regulator.c: In function ‘tps65217_regulator_probe’:
 drivers/regulator/tps65217-regulator.c:227:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
 227 | int i, ret;
 | ^~~

Cc: Russ Dill <redacted>
Cc: Keerthy <j-keerthy@ti.com>
Cc: AnilKumar Ch <redacted>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Lee Jones <redacted>
---
 drivers/regulator/tps65217-regulator.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index f2d3a4a9f3e77..3f5ea029e2e3f 100644
--- a/drivers/regulator/tps65217-regulator.c
+++ b/drivers/regulator/tps65217-regulator.c
@@ -254,6 +254,9 @@ static int tps65217_regulator_probe(struct platform_device *pdev)
 
 		/* Store default strobe info */
 		ret = tps65217_reg_read(tps, regulators[i].bypass_reg, &val);
+		if (ret)
+			return ret;
+
 		tps->strobes[i] = val & regulators[i].bypass_mask;
 	}
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help