Commit a04be4b6 authored by Michael Tretter's avatar Michael Tretter Committed by David S. Miller

net: macb: simplify clk_init with dev_err_probe

On some platforms, e.g., the ZynqMP, devm_clk_get can return
-EPROBE_DEFER if the clock controller, which is implemented in firmware,
has not been probed yet.

As clk_init is only called during probe, use dev_err_probe to simplify
the error message and hide it for -EPROBE_DEFER.
Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4cb50d00
...@@ -3758,17 +3758,15 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, ...@@ -3758,17 +3758,15 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
*hclk = devm_clk_get(&pdev->dev, "hclk"); *hclk = devm_clk_get(&pdev->dev, "hclk");
} }
if (IS_ERR_OR_NULL(*pclk)) { if (IS_ERR_OR_NULL(*pclk))
err = IS_ERR(*pclk) ? PTR_ERR(*pclk) : -ENODEV; return dev_err_probe(&pdev->dev,
dev_err(&pdev->dev, "failed to get macb_clk (%d)\n", err); IS_ERR(*pclk) ? PTR_ERR(*pclk) : -ENODEV,
return err; "failed to get pclk\n");
}
if (IS_ERR_OR_NULL(*hclk))
if (IS_ERR_OR_NULL(*hclk)) { return dev_err_probe(&pdev->dev,
err = IS_ERR(*hclk) ? PTR_ERR(*hclk) : -ENODEV; IS_ERR(*hclk) ? PTR_ERR(*hclk) : -ENODEV,
dev_err(&pdev->dev, "failed to get hclk (%d)\n", err); "failed to get hclk\n");
return err;
}
*tx_clk = devm_clk_get_optional(&pdev->dev, "tx_clk"); *tx_clk = devm_clk_get_optional(&pdev->dev, "tx_clk");
if (IS_ERR(*tx_clk)) if (IS_ERR(*tx_clk))
......
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