Skip to content

Commit 366df82

Browse files
committed
mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock
Use the existing devm_clk_get_optional() helper to obtain the optional Card Detect clock, instead of open-coding the same operation. a side effect, real errors will now be handled correctly instead of being ignored. Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Ulf Hansson <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/540d803d31bf9aa1d0f78f431cae0ccd05387edc.1637069733.git.geert+renesas@glider.be
1 parent 827fbac commit 366df82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,9 +936,9 @@ int renesas_sdhi_probe(struct platform_device *pdev,
936936
* to the card detect circuit. That leaves us with if separate clocks
937937
* are presented, we must treat them both as virtually 1 clock.
938938
*/
939-
priv->clk_cd = devm_clk_get(&pdev->dev, "cd");
939+
priv->clk_cd = devm_clk_get_optional(&pdev->dev, "cd");
940940
if (IS_ERR(priv->clk_cd))
941-
priv->clk_cd = NULL;
941+
return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk_cd), "cannot get cd clock");
942942

943943
priv->pinctrl = devm_pinctrl_get(&pdev->dev);
944944
if (!IS_ERR(priv->pinctrl)) {

0 commit comments

Comments
 (0)