From: Martin Kaiser <martin@kaiser.cx>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: aric.pzqi@ingenic.com, linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 7/7] hwrng: ingenic - switch to device managed registration
Date: Mon, 10 Jul 2023 22:27:33 +0200 [thread overview]
Message-ID: <20230710202733.116133-8-martin@kaiser.cx> (raw)
In-Reply-To: <20230710202733.116133-1-martin@kaiser.cx>
Call devm_hwrng_register for device managed registration of the
ingenic-trng driver. ingenic_trng_remove can then be deleted.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/char/hw_random/ingenic-trng.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/char/hw_random/ingenic-trng.c b/drivers/char/hw_random/ingenic-trng.c
index 9c54721f8399..3967a8dbe967 100644
--- a/drivers/char/hw_random/ingenic-trng.c
+++ b/drivers/char/hw_random/ingenic-trng.c
@@ -98,7 +98,7 @@ static int ingenic_trng_probe(struct platform_device *pdev)
trng->rng.cleanup = ingenic_trng_cleanup;
trng->rng.read = ingenic_trng_read;
- ret = hwrng_register(&trng->rng);
+ ret = devm_hwrng_register(&pdev->dev, &trng->rng);
if (ret)
return dev_err_probe(&pdev->dev, ret, "Failed to register hwrng\n");
@@ -108,15 +108,6 @@ static int ingenic_trng_probe(struct platform_device *pdev)
return 0;
}
-static int ingenic_trng_remove(struct platform_device *pdev)
-{
- struct ingenic_trng *trng = platform_get_drvdata(pdev);
-
- hwrng_unregister(&trng->rng);
-
- return 0;
-}
-
static const struct of_device_id ingenic_trng_of_match[] = {
{ .compatible = "ingenic,x1830-dtrng" },
{ /* sentinel */ }
@@ -125,7 +116,6 @@ MODULE_DEVICE_TABLE(of, ingenic_trng_of_match);
static struct platform_driver ingenic_trng_driver = {
.probe = ingenic_trng_probe,
- .remove = ingenic_trng_remove,
.driver = {
.name = "ingenic-trng",
.of_match_table = ingenic_trng_of_match,
--
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-10 20:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 20:27 hwrng: ingenic: simplify the code Martin Kaiser
2023-07-10 20:27 ` [PATCH 1/7] hwrng: ingenic - enable compile testing Martin Kaiser
2023-07-10 20:27 ` [PATCH 2/7] hwrng: ingenic - remove two unused defines Martin Kaiser
2023-07-10 20:27 ` [PATCH 3/7] hwrng: ingenic - remove dead assignments Martin Kaiser
2023-07-10 20:27 ` [PATCH 4/7] hwrng: ingenic - use devm_clk_get_enabled Martin Kaiser
2023-07-10 20:27 ` [PATCH 5/7] hwrng: ingenic - use dev_err_probe in error paths Martin Kaiser
2023-07-10 20:27 ` [PATCH 6/7] hwrng: ingenic - don't disable the rng in ingenic_trng_remove Martin Kaiser
2023-07-10 20:27 ` Martin Kaiser [this message]
2023-07-22 2:13 ` hwrng: ingenic: simplify the code 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=20230710202733.116133-8-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=aric.pzqi@ingenic.com \
--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 \
/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).