Commit e61a2356 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Herbert Xu

crypto: sun8i - 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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 5a062f09
...@@ -573,12 +573,9 @@ static int sun8i_ce_probe(struct platform_device *pdev) ...@@ -573,12 +573,9 @@ static int sun8i_ce_probe(struct platform_device *pdev)
return irq; return irq;
ce->reset = devm_reset_control_get(&pdev->dev, NULL); ce->reset = devm_reset_control_get(&pdev->dev, NULL);
if (IS_ERR(ce->reset)) { if (IS_ERR(ce->reset))
if (PTR_ERR(ce->reset) == -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(ce->reset),
return PTR_ERR(ce->reset); "No reset control found\n");
dev_err(&pdev->dev, "No reset control found\n");
return PTR_ERR(ce->reset);
}
mutex_init(&ce->mlock); mutex_init(&ce->mlock);
......
...@@ -545,12 +545,9 @@ static int sun8i_ss_probe(struct platform_device *pdev) ...@@ -545,12 +545,9 @@ static int sun8i_ss_probe(struct platform_device *pdev)
return irq; return irq;
ss->reset = devm_reset_control_get(&pdev->dev, NULL); ss->reset = devm_reset_control_get(&pdev->dev, NULL);
if (IS_ERR(ss->reset)) { if (IS_ERR(ss->reset))
if (PTR_ERR(ss->reset) == -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(ss->reset),
return PTR_ERR(ss->reset); "No reset control found\n");
dev_err(&pdev->dev, "No reset control found\n");
return PTR_ERR(ss->reset);
}
mutex_init(&ss->mlock); mutex_init(&ss->mlock);
......
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