diff mbox series

[3/3] hwrng: ba431 - use dev_err_probe after failed registration

Message ID 20230713070446.230978-4-martin@kaiser.cx (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series hwrng: ba431 - trivial cleanups | expand

Commit Message

Martin Kaiser July 13, 2023, 7:04 a.m. UTC
Use dev_err_probe to print the error message after a failed hwrng
registration.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/ba431-rng.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index d2a9d16323a6..9de7466e6896 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -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");