summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/nomadik-rng.c
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-25 10:01:55 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-08-02 06:44:33 +0200
commit3e75241be8081f22f7382f4041496b10a4d9aed0 (patch)
treea6605ba766c278cd25ef20a27b3b05bba2c6c389 /drivers/char/hw_random/nomadik-rng.c
parentcrypto: jitterentropy - build without sanitizer (diff)
downloadlinux-3e75241be8081f22f7382f4041496b10a4d9aed0.tar.xz
linux-3e75241be8081f22f7382f4041496b10a4d9aed0.zip
hwrng: drivers - Use device-managed registration API
Use devm_hwrng_register to simplify the implementation. Manual unregistration and some remove functions can be removed now. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Acked-by: Ɓukasz Stelmach <l.stelmach@samsung.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random/nomadik-rng.c')
-rw-r--r--drivers/char/hw_random/nomadik-rng.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c
index fc0f6b0cb80d..74ed29f42e4f 100644
--- a/drivers/char/hw_random/nomadik-rng.c
+++ b/drivers/char/hw_random/nomadik-rng.c
@@ -57,7 +57,7 @@ static int nmk_rng_probe(struct amba_device *dev, const struct amba_id *id)
if (!base)
goto out_release;
nmk_rng.priv = (unsigned long)base;
- ret = hwrng_register(&nmk_rng);
+ ret = devm_hwrng_register(&dev->dev, &nmk_rng);
if (ret)
goto out_release;
return 0;
@@ -71,7 +71,6 @@ out_clk:
static int nmk_rng_remove(struct amba_device *dev)
{
- hwrng_unregister(&nmk_rng);
amba_release_regions(dev);
clk_disable(rng_clk);
return 0;