public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] i2c: sun6i-p2wi: Fix an error message in probe()
@ 2023-06-27  7:12 Dan Carpenter
  2023-06-27 11:59 ` Andi Shyti
  2023-08-14 15:53 ` Wolfram Sang
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Carpenter @ 2023-06-27  7:12 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Wolfram Sang,
	linux-i2c, linux-arm-kernel, linux-sunxi, kernel-janitors

The "ret" variable is uninitialized.  It was the "p2wi->rstc" variable
that was intended.  We can also use the %pe string format to print the
error code name instead of just the number.

Fixes: 75ff8a340a81 ("i2c: sun6i-p2wi: Use devm_clk_get_enabled()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/i2c/busses/i2c-sun6i-p2wi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-sun6i-p2wi.c b/drivers/i2c/busses/i2c-sun6i-p2wi.c
index ad8270cdbd3e..fa6020dced59 100644
--- a/drivers/i2c/busses/i2c-sun6i-p2wi.c
+++ b/drivers/i2c/busses/i2c-sun6i-p2wi.c
@@ -250,7 +250,8 @@ static int p2wi_probe(struct platform_device *pdev)
 
 	p2wi->rstc = devm_reset_control_get_exclusive(dev, NULL);
 	if (IS_ERR(p2wi->rstc)) {
-		dev_err(dev, "failed to retrieve reset controller: %d\n", ret);
+		dev_err(dev, "failed to retrieve reset controller: %pe\n",
+			p2wi->rstc);
 		return PTR_ERR(p2wi->rstc);
 	}
 
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-14 15:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27  7:12 [PATCH] i2c: sun6i-p2wi: Fix an error message in probe() Dan Carpenter
2023-06-27 11:59 ` Andi Shyti
2023-06-27 12:08   ` Dan Carpenter
2023-06-27 13:33     ` Andi Shyti
2023-06-30 19:58     ` Christophe JAILLET
2023-07-01  9:42       ` Dan Carpenter
2023-08-14 15:53 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox