summaryrefslogtreecommitdiff
path: root/drivers/char/hw_random/st-rng.c
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-25 16:01:55 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-08-02 14:44:33 +1000
commit3e75241be8081f22f7382f4041496b10a4d9aed0 (patch)
treea6605ba766c278cd25ef20a27b3b05bba2c6c389 /drivers/char/hw_random/st-rng.c
parentdec0fb3946c478e7bb6165a1b7a03092ceefd419 (diff)
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/st-rng.c')
-rw-r--r--drivers/char/hw_random/st-rng.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c
index bd6a98b3479b..863448360a7d 100644
--- a/drivers/char/hw_random/st-rng.c
+++ b/drivers/char/hw_random/st-rng.c
@@ -102,7 +102,7 @@ static int st_rng_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, ddata);
- ret = hwrng_register(&ddata->ops);
+ ret = devm_hwrng_register(&pdev->dev, &ddata->ops);
if (ret) {
dev_err(&pdev->dev, "Failed to register HW RNG\n");
clk_disable_unprepare(clk);
@@ -118,8 +118,6 @@ static int st_rng_remove(struct platform_device *pdev)
{
struct st_rng_data *ddata = dev_get_drvdata(&pdev->dev);
- hwrng_unregister(&ddata->ops);
-
clk_disable_unprepare(ddata->clk);
return 0;