Skip to content

Commit eb7641f

Browse files
Dan Carpentergregkh
authored andcommitted
i2c: rcar: fix error code in probe()
commit 37a672b upstream. Return an error code if devm_reset_control_get_exclusive() fails. The current code returns success. Fixes: 0e864b5 ("i2c: rcar: reset controller is mandatory for Gen3+") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e243c11 commit eb7641f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/i2c/busses/i2c-rcar.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,8 +1121,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
11211121
/* R-Car Gen3+ needs a reset before every transfer */
11221122
if (priv->devtype >= I2C_RCAR_GEN3) {
11231123
priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
1124-
if (IS_ERR(priv->rstc))
1124+
if (IS_ERR(priv->rstc)) {
1125+
ret = PTR_ERR(priv->rstc);
11251126
goto out_pm_put;
1127+
}
11261128

11271129
ret = reset_control_status(priv->rstc);
11281130
if (ret < 0)

0 commit comments

Comments
 (0)