aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-09-27 15:38:36 +0300
committerWolfram Sang <wsa@kernel.org>2023-09-27 21:54:25 +0200
commit37a672be3ae357a0f87fbc00897fa7fcb3d7d782 (patch)
tree9ed715a05c3815e56f4ed4577270efd724fde4ee /drivers/i2c/busses
parent470a662688563d8f5e0fb164930d6f5507a883e4 (diff)
downloadlinux-37a672be3ae357a0f87fbc00897fa7fcb3d7d782.tar.gz
i2c: rcar: fix error code in probe()
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>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-rcar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 8417d5bc662b5c..829ac053bbb7c4 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)