mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 20:37:19 +07:00
crypto: stm32-hash - Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
9d72d022ee
commit
5a062f0916
@ -1464,14 +1464,9 @@ static int stm32_hash_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
hdev->clk = devm_clk_get(&pdev->dev, NULL);
|
hdev->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(hdev->clk)) {
|
if (IS_ERR(hdev->clk))
|
||||||
if (PTR_ERR(hdev->clk) != -EPROBE_DEFER) {
|
return dev_err_probe(dev, PTR_ERR(hdev->clk),
|
||||||
dev_err(dev, "failed to get clock for hash (%lu)\n",
|
"failed to get clock for hash\n");
|
||||||
PTR_ERR(hdev->clk));
|
|
||||||
}
|
|
||||||
|
|
||||||
return PTR_ERR(hdev->clk);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = clk_prepare_enable(hdev->clk);
|
ret = clk_prepare_enable(hdev->clk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Loading…
Reference in New Issue
Block a user