can: rcar_canfd: Use devm_reset_control_get_optional_exclusive
authorBiju Das <biju.das.jz@bp.renesas.com>
Tue, 25 Oct 2022 15:56:57 +0000 (16:56 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 26 Oct 2022 08:24:08 +0000 (10:24 +0200)
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: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/all/20221025155657.1426948-4-biju.das.jz@bp.renesas.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rcar/rcar_canfd.c

index 567620d215f83b09150eea01f53d25d7b3670c25..9a55a54c4507c4f7e85efdcf74892716329e9b37 100644 (file)
@@ -1889,17 +1889,17 @@ static int rcar_canfd_probe(struct platform_device *pdev)
        gpriv->chip_id = chip_id;
        gpriv->max_channels = max_channels;
 
-       if (gpriv->chip_id == RENESAS_RZG2L) {
-               gpriv->rstc1 = devm_reset_control_get_exclusive(&pdev->dev, "rstp_n");
-               if (IS_ERR(gpriv->rstc1))
-                       return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc1),
-                                            "failed to get rstp_n\n");
-
-               gpriv->rstc2 = devm_reset_control_get_exclusive(&pdev->dev, "rstc_n");
-               if (IS_ERR(gpriv->rstc2))
-                       return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc2),
-                                            "failed to get rstc_n\n");
-       }
+       gpriv->rstc1 = devm_reset_control_get_optional_exclusive(&pdev->dev,
+                                                                "rstp_n");
+       if (IS_ERR(gpriv->rstc1))
+               return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc1),
+                                    "failed to get rstp_n\n");
+
+       gpriv->rstc2 = devm_reset_control_get_optional_exclusive(&pdev->dev,
+                                                                "rstc_n");
+       if (IS_ERR(gpriv->rstc2))
+               return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc2),
+                                    "failed to get rstc_n\n");
 
        /* Peripheral clock */
        gpriv->clkp = devm_clk_get(&pdev->dev, "fck");