From: Martin Kaiser <martin@kaiser.cx>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: olivier@sobrie.be, linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration
Date: Thu, 13 Jul 2023 09:04:46 +0200 [thread overview]
Message-ID: <20230713070446.230978-4-martin@kaiser.cx> (raw)
In-Reply-To: <20230713070446.230978-1-martin@kaiser.cx>
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 --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");
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-13 7:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 7:04 [PATCH 0/3] hwrng: ba431 - trivial cleanups Martin Kaiser
2023-07-13 7:04 ` [PATCH 1/3] hwrng: ba431 - do not set drvdata Martin Kaiser
2023-07-13 7:04 ` [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data Martin Kaiser
2023-07-13 7:04 ` Martin Kaiser [this message]
2023-07-22 2:13 ` [PATCH 0/3] hwrng: ba431 - trivial cleanups Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230713070446.230978-4-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olivier@sobrie.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).