Skip to content

Commit 37a672b

Browse files
Dan Carpenterwsakernel
authored andcommitted
i2c: rcar: fix error code in probe()
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]>
1 parent 470a662 commit 37a672b

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
@@ -1153,8 +1153,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
11531153

11541154
if (priv->devtype == I2C_RCAR_GEN3) {
11551155
priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
1156-
if (IS_ERR(priv->rstc))
1156+
if (IS_ERR(priv->rstc)) {
1157+
ret = PTR_ERR(priv->rstc);
11571158
goto out_pm_put;
1159+
}
11581160

11591161
ret = reset_control_status(priv->rstc);
11601162
if (ret < 0)

0 commit comments

Comments
 (0)