Commit 37a672be authored by Dan Carpenter's avatar Dan Carpenter Committed by Wolfram Sang
Browse files

i2c: rcar: fix error code in probe()



Return an error code if devm_reset_control_get_exclusive() fails.
The current code returns success.

Fixes: 0e864b55 ("i2c: rcar: reset controller is mandatory for Gen3+")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 470a6626
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)