summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/atmel-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/atmel-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/atmel-rng.c')
-rw-r--r--drivers/char/hw_random/atmel-rng.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 433426242b87..e55705745d5e 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -86,7 +86,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
trng->rng.name = pdev->name;
trng->rng.read = atmel_trng_read;
- ret = hwrng_register(&trng->rng);
+ ret = devm_hwrng_register(&pdev->dev, &trng->rng);
if (ret)
goto err_register;
@@ -103,7 +103,6 @@ static int atmel_trng_remove(struct platform_device *pdev)
{
struct atmel_trng *trng = platform_get_drvdata(pdev);
- hwrng_unregister(&trng->rng);
atmel_trng_disable(trng);
clk_disable_unprepare(trng->clk);