Skip to content

Commit

Permalink
hwrng: ba431 - use dev_err_probe after failed registration
Browse files Browse the repository at this point in the history
Use dev_err_probe to print the error message after a failed hwrng
registration.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
martin-kaiser authored and herbertx committed Jul 22, 2023
1 parent 97b7aa7 commit 1422e36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/char/hw_random/ba431-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ static int ba431_trng_probe(struct platform_device *pdev)
ba431->rng.read = ba431_trng_read;

ret = devm_hwrng_register(&pdev->dev, &ba431->rng);
if (ret) {
dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret);
return ret;
}
if (ret)
return dev_err_probe(&pdev->dev, ret, "BA431 registration failed\n");

dev_info(&pdev->dev, "BA431 TRNG registered\n");

Expand Down

0 comments on commit 1422e36

Please sign in to comment.