Message ID | 1614569093-31192-1-git-send-email-tiantao6@hisilicon.com |
---|---|
State | Accepted |
Commit | 7ea39973d1e5a73a7443c0ed96faec83224a80e3 |
Headers | show |
Series | hwrng: pic32 - Use device-managed registration API | expand |
On Mon, Mar 01, 2021 at 11:24:53AM +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/pic32-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 --git a/drivers/char/hw_random/pic32-rng.c b/drivers/char/hw_random/pic32-rng.c index e8210c1..99c8bd0 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;
Use devm_hwrng_register to get rid of manual unregistration. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> --- drivers/char/hw_random/pic32-rng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)