diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2021-03-01 05:43:48 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-03-12 16:04:00 +0300 |
commit | ae8351284b74bf93eb4d2b67178f2e9a09c19932 (patch) | |
tree | 220fcbbd5daf469638a31c2bbca883a0eda46afa /drivers/char | |
parent | 1406f0f3440265deec6932fd611549b07ac76e89 (diff) | |
download | linux-ae8351284b74bf93eb4d2b67178f2e9a09c19932.tar.xz |
hwrng: cctrng - 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/cctrng.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c index 7a293f2147a0..0efb37adbfa3 100644 --- a/drivers/char/hw_random/cctrng.c +++ b/drivers/char/hw_random/cctrng.c @@ -585,7 +585,7 @@ static int cctrng_probe(struct platform_device *pdev) atomic_set(&drvdata->pending_hw, 1); /* registration of the hwrng device */ - rc = hwrng_register(&drvdata->rng); + rc = devm_hwrng_register(dev, &drvdata->rng); if (rc) { dev_err(dev, "Could not register hwrng device.\n"); goto post_pm_err; @@ -618,8 +618,6 @@ static int cctrng_remove(struct platform_device *pdev) dev_dbg(dev, "Releasing cctrng resources...\n"); - hwrng_unregister(&drvdata->rng); - cc_trng_pm_fini(drvdata); cc_trng_clk_fini(drvdata); |