Skip to content

Commit

Permalink
i2c: sun6i-p2wi: Fix an error message in probe()
Browse files Browse the repository at this point in the history
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: 75ff8a3 ("i2c: sun6i-p2wi: Use devm_clk_get_enabled()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Dan Carpenter authored and Wolfram Sang committed Aug 14, 2023
1 parent fff67c1 commit 0abbf0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-sun6i-p2wi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0abbf0a

Please sign in to comment.