diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2021-03-01 11:24:53 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-03-13 00:04:00 +1100 |
commit | 7ea39973d1e5a73a7443c0ed96faec83224a80e3 (patch) | |
tree | 5582004d12c7e69d10137ba32640a537def7ad81 /drivers/char/hw_random | |
parent | ae8351284b74bf93eb4d2b67178f2e9a09c19932 (diff) | |
download | linux-7ea39973d1e5a73a7443c0ed96faec83224a80e3.tar.bz2 |
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/hw_random')
-rw-r--r-- | drivers/char/hw_random/pic32-rng.c | 3 |
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; |