* [PATCH] hwrng: ba431 - Use device-managed registration
@ 2021-02-09 1:35 Tian Tao
2021-03-04 6:35 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2021-02-09 1:35 UTC (permalink / raw)
To: mpm, herbert; +Cc: linux-crypto
Use device-managed registration, so we can delete the ba431_trng_remove.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/char/hw_random/ba431-rng.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index 410b50b..4f514e2 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -193,7 +193,7 @@ static int ba431_trng_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ba431);
- ret = hwrng_register(&ba431->rng);
+ ret = devm_hwrng_register(&pdev->dev, &ba431->rng);
if (ret) {
dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret);
return ret;
@@ -204,15 +204,6 @@ static int ba431_trng_probe(struct platform_device *pdev)
return 0;
}
-static int ba431_trng_remove(struct platform_device *pdev)
-{
- struct ba431_trng *ba431 = platform_get_drvdata(pdev);
-
- hwrng_unregister(&ba431->rng);
-
- return 0;
-}
-
static const struct of_device_id ba431_trng_dt_ids[] = {
{ .compatible = "silex-insight,ba431-rng", .data = NULL },
{ /* sentinel */ }
@@ -225,7 +216,6 @@ static struct platform_driver ba431_trng_driver = {
.of_match_table = ba431_trng_dt_ids,
},
.probe = ba431_trng_probe,
- .remove = ba431_trng_remove,
};
module_platform_driver(ba431_trng_driver);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwrng: ba431 - Use device-managed registration
2021-02-09 1:35 [PATCH] hwrng: ba431 - Use device-managed registration Tian Tao
@ 2021-03-04 6:35 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-03-04 6:35 UTC (permalink / raw)
To: Tian Tao; +Cc: mpm, linux-crypto
On Tue, Feb 09, 2021 at 09:35:34AM +0800, Tian Tao wrote:
> Use device-managed registration, so we can delete the ba431_trng_remove.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
> drivers/char/hw_random/ba431-rng.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-04 6:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 1:35 [PATCH] hwrng: ba431 - Use device-managed registration Tian Tao
2021-03-04 6:35 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.