Commit 68399ff5 authored by Biju Das's avatar Biju Das Committed by Marc Kleine-Budde

can: rcar_canfd: Use devm_reset_control_get_optional_exclusive

Replace devm_reset_control_get_exclusive->devm_reset_control_
get_optional_exclusive so that we can avoid unnecessary
SoC specific check in probe().
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/all/20221025155657.1426948-4-biju.das.jz@bp.renesas.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent aa9832e4
...@@ -1889,17 +1889,17 @@ static int rcar_canfd_probe(struct platform_device *pdev) ...@@ -1889,17 +1889,17 @@ static int rcar_canfd_probe(struct platform_device *pdev)
gpriv->chip_id = chip_id; gpriv->chip_id = chip_id;
gpriv->max_channels = max_channels; gpriv->max_channels = max_channels;
if (gpriv->chip_id == RENESAS_RZG2L) { gpriv->rstc1 = devm_reset_control_get_optional_exclusive(&pdev->dev,
gpriv->rstc1 = devm_reset_control_get_exclusive(&pdev->dev, "rstp_n"); "rstp_n");
if (IS_ERR(gpriv->rstc1)) if (IS_ERR(gpriv->rstc1))
return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc1), return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc1),
"failed to get rstp_n\n"); "failed to get rstp_n\n");
gpriv->rstc2 = devm_reset_control_get_exclusive(&pdev->dev, "rstc_n"); gpriv->rstc2 = devm_reset_control_get_optional_exclusive(&pdev->dev,
if (IS_ERR(gpriv->rstc2)) "rstc_n");
return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc2), if (IS_ERR(gpriv->rstc2))
"failed to get rstc_n\n"); return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc2),
} "failed to get rstc_n\n");
/* Peripheral clock */ /* Peripheral clock */
gpriv->clkp = devm_clk_get(&pdev->dev, "fck"); gpriv->clkp = devm_clk_get(&pdev->dev, "fck");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment