aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-02-07 10:39:05 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-02-10 17:56:01 +1100
commit0de9dc80625b0ca1cb9730c5ed1c5a8cab538369 (patch)
treed67e51fc2b40482161e479b4ca856f23b98862d3
parentcrypto: hisilicon/qm - fix printing format issue (diff)
downloadlinux-dev-0de9dc80625b0ca1cb9730c5ed1c5a8cab538369.tar.xz
linux-dev-0de9dc80625b0ca1cb9730c5ed1c5a8cab538369.zip
hwrng: timeriomem - Use device-managed registration API
Use devm_hwrng_register to get rid of manual unregistration. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/char/hw_random/timeriomem-rng.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
index f35f0f31f52a..8ea1fc831eb7 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;