diff mbox series

i2c: rcar: fix error code in probe()

Message ID 06d4de31-dfe5-432d-acab-600b01422155@moroto.mountain (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series i2c: rcar: fix error code in probe() | expand

Commit Message

Dan Carpenter Sept. 27, 2023, 12:38 p.m. UTC
Return an error code if devm_reset_control_get_exclusive() fails.
The current code returns success.

Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/i2c/busses/i2c-rcar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Sept. 27, 2023, 12:53 p.m. UTC | #1
On Wed, Sep 27, 2023 at 2:38 PM Dan Carpenter <dan.carpenter@linaro.org> wrote:
> Return an error code if devm_reset_control_get_exclusive() fails.
> The current code returns success.
>
> Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Wolfram Sang Sept. 27, 2023, 7:55 p.m. UTC | #2
On Wed, Sep 27, 2023 at 03:38:36PM +0300, Dan Carpenter wrote:
> Return an error code if devm_reset_control_get_exclusive() fails.
> The current code returns success.
> 
> Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 8417d5bc662b..829ac053bbb7 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -1153,8 +1153,10 @@  static int rcar_i2c_probe(struct platform_device *pdev)
 
 	if (priv->devtype == I2C_RCAR_GEN3) {
 		priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-		if (IS_ERR(priv->rstc))
+		if (IS_ERR(priv->rstc)) {
+			ret = PTR_ERR(priv->rstc);
 			goto out_pm_put;
+		}
 
 		ret = reset_control_status(priv->rstc);
 		if (ret < 0)