summaryrefslogtreecommitdiff
path: root/drivers/char/hw_random/powernv-rng.c
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-25 11:01:55 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-08-02 07:44:33 +0300
commit3e75241be8081f22f7382f4041496b10a4d9aed0 (patch)
treea6605ba766c278cd25ef20a27b3b05bba2c6c389 /drivers/char/hw_random/powernv-rng.c
parentdec0fb3946c478e7bb6165a1b7a03092ceefd419 (diff)
downloadlinux-3e75241be8081f22f7382f4041496b10a4d9aed0.tar.xz
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/powernv-rng.c')
-rw-r--r--drivers/char/hw_random/powernv-rng.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/char/hw_random/powernv-rng.c b/drivers/char/hw_random/powernv-rng.c
index f2e8272e276a..8da1d7917bdc 100644
--- a/drivers/char/hw_random/powernv-rng.c
+++ b/drivers/char/hw_random/powernv-rng.c
@@ -33,18 +33,11 @@ static struct hwrng powernv_hwrng = {
.read = powernv_rng_read,
};
-static int powernv_rng_remove(struct platform_device *pdev)
-{
- hwrng_unregister(&powernv_hwrng);
-
- return 0;
-}
-
static int powernv_rng_probe(struct platform_device *pdev)
{
int rc;
- rc = hwrng_register(&powernv_hwrng);
+ rc = devm_hwrng_register(&pdev->dev, &powernv_hwrng);
if (rc) {
/* We only register one device, ignore any others */
if (rc == -EEXIST)
@@ -70,7 +63,6 @@ static struct platform_driver powernv_rng_driver = {
.of_match_table = powernv_rng_match,
},
.probe = powernv_rng_probe,
- .remove = powernv_rng_remove,
};
module_platform_driver(powernv_rng_driver);