提交 4d6aef2f 编写于 作者: K Krzysztof Kozlowski 提交者: Herbert Xu

hwrng: cctrn - Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.
Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: NHadar Gat <hadar.gat@arm.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 d08d387b
...@@ -463,11 +463,10 @@ static int cc_trng_clk_init(struct cctrng_drvdata *drvdata) ...@@ -463,11 +463,10 @@ static int cc_trng_clk_init(struct cctrng_drvdata *drvdata)
int rc = 0; int rc = 0;
clk = devm_clk_get_optional(dev, NULL); clk = devm_clk_get_optional(dev, NULL);
if (IS_ERR(clk)) { if (IS_ERR(clk))
if (PTR_ERR(clk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(clk),
dev_err(dev, "Error getting clock: %pe\n", clk); "Error getting clock\n");
return PTR_ERR(clk);
}
drvdata->clk = clk; drvdata->clk = clk;
rc = clk_prepare_enable(drvdata->clk); rc = clk_prepare_enable(drvdata->clk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册