提交 f7324d4b 编写于 作者: U Uwe Kleine-König 提交者: Herbert Xu

hwrng: meson - Improve error handling for core clock

-ENOENT (ie. "there is no clock") is fine to ignore for an optional
clock, other values are not supposed to be ignored and should be
escalated to the caller (e.g. -EPROBE_DEFER). Ignore -ENOENT by using
devm_clk_get_optional().

While touching this code also add an error message for the fatal errors.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
Reviewed-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 adad556e
......@@ -54,9 +54,10 @@ static int meson_rng_probe(struct platform_device *pdev)
if (IS_ERR(data->base))
return PTR_ERR(data->base);
data->core_clk = devm_clk_get(dev, "core");
data->core_clk = devm_clk_get_optional(dev, "core");
if (IS_ERR(data->core_clk))
data->core_clk = NULL;
return dev_err_probe(dev, PTR_ERR(data->core_clk),
"Failed to get core clock\n");
if (data->core_clk) {
ret = clk_prepare_enable(data->core_clk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册