diff mbox series

hw_random: timeriomem_rng: Use device-managed registration API

Message ID 1612665545-43612-1-git-send-email-tiantao6@hisilicon.com
State Accepted
Commit 0de9dc80625b0ca1cb9730c5ed1c5a8cab538369
Headers show
Series hw_random: timeriomem_rng: Use device-managed registration API | expand

Commit Message

Tian Tao Feb. 7, 2021, 2:39 a.m. UTC
Use devm_hwrng_register to get rid of manual unregistration.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/char/hw_random/timeriomem-rng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Herbert Xu Feb. 10, 2021, 7:24 a.m. UTC | #1
On Sun, Feb 07, 2021 at 10:39:05AM +0800, Tian Tao wrote:
> Use devm_hwrng_register to get rid of manual unregistration.

> 

> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

> ---

>  drivers/char/hw_random/timeriomem-rng.c | 3 +--

>  1 file changed, 1 insertion(+), 2 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
diff mbox series

Patch

diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
index e262445..9c237a0 100644
--- a/drivers/char/hw_random/timeriomem-rng.c
+++ b/drivers/char/hw_random/timeriomem-rng.c
@@ -169,7 +169,7 @@  static int timeriomem_rng_probe(struct platform_device *pdev)
 	priv->present = 1;
 	complete(&priv->completion);
 
-	err = hwrng_register(&priv->rng_ops);
+	err = devm_hwrng_register(&pdev->dev, &priv->rng_ops);
 	if (err) {
 		dev_err(&pdev->dev, "problem registering\n");
 		return err;
@@ -185,7 +185,6 @@  static int timeriomem_rng_remove(struct platform_device *pdev)
 {
 	struct timeriomem_rng_private *priv = platform_get_drvdata(pdev);
 
-	hwrng_unregister(&priv->rng_ops);
 	hrtimer_cancel(&priv->timer);
 
 	return 0;