diff mbox series

[RFC,9/9] mmc: renesas_sdhi: parse DT for SDnH

Message ID 20210928200804.50922-10-wsa+renesas@sang-engineering.com (mailing list archive)
State New, archived
Headers show
Series clk/mmc: renesas_sdhi: refactor SDnH to be a seperate clock | expand

Commit Message

Wolfram Sang Sept. 28, 2021, 8:08 p.m. UTC
If there is a SDnH clock provided in DT, let's use it instead of relying
on the fallback.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Oct. 11, 2021, 6:04 p.m. UTC | #1
On Tue, Sep 28, 2021 at 10:08 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> If there is a SDnH clock provided in DT, let's use it instead of relying
> on the fallback.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 100f86d311ea..41a5ee80c661 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -922,8 +922,16 @@  int renesas_sdhi_probe(struct platform_device *pdev,
 		return ret;
 	}
 
+	priv->clkh = devm_clk_get_optional(&pdev->dev, "clkh");
+	if (IS_ERR(priv->clkh)) {
+		ret = PTR_ERR(priv->clkh);
+		dev_err(&pdev->dev, "cannot get clockh: %d\n", ret);
+		return ret;
+	}
+
 	/* Fallback for old DTs */
-	if (of_device_is_compatible(pdev->dev.of_node, "renesas,rcar-gen3-sdhi"))
+	if (!priv->clkh &&
+	    of_device_is_compatible(pdev->dev.of_node, "renesas,rcar-gen3-sdhi"))
 		priv->clkh = clk_get_parent(clk_get_parent(priv->clk));
 
 	/*