summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-03-01 11:24:53 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-13 00:04:00 +1100
commit7ea39973d1e5a73a7443c0ed96faec83224a80e3 (patch)
tree5582004d12c7e69d10137ba32640a537def7ad81 /drivers/char
parentae8351284b74bf93eb4d2b67178f2e9a09c19932 (diff)
hwrng: pic32 - 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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/pic32-rng.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/hw_random/pic32-rng.c b/drivers/char/hw_random/pic32-rng.c
index e8210c1715cf..99c8bd0859a1 100644
--- a/drivers/char/hw_random/pic32-rng.c
+++ b/drivers/char/hw_random/pic32-rng.c
@@ -96,7 +96,7 @@ static int pic32_rng_probe(struct platform_device *pdev)
priv->rng.name = pdev->name;
priv->rng.read = pic32_rng_read;
- ret = hwrng_register(&priv->rng);
+ ret = devm_hwrng_register(&pdev->dev, &priv->rng);
if (ret)
goto err_register;
@@ -113,7 +113,6 @@ static int pic32_rng_remove(struct platform_device *pdev)
{
struct pic32_rng *rng = platform_get_drvdata(pdev);
- hwrng_unregister(&rng->rng);
writel(0, rng->base + RNGCON);
clk_disable_unprepare(rng->clk);
return 0;