diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-09-27 15:38:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-18 13:07:45 +0200 |
commit | f0655a5c8f3e62002c99f111e1d651a8fa0418f8 (patch) | |
tree | bbc343db52f652b35af21684abea84134b9d8145 | |
parent | 181a157af8a43a4d120f34e7e60be0fe0363a902 (diff) |
i2c: rcar: fix error code in probe()
commit 37a672be3ae357a0f87fbc00897fa7fcb3d7d782 upstream.
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>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/i2c/busses/i2c-rcar.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 1b5ea222f4c6..316dd378fb8c 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -1105,8 +1105,10 @@ static int rcar_i2c_probe(struct platform_device *pdev) /* R-Car Gen3+ needs a reset before every transfer */ 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) |