summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-02-09 04:35:34 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-07 07:13:14 +0300
commit3e2ccc7454510e0990104eaf6f24f34be121dabb (patch)
treee24eadf5430805dd5ccfda4695e40ac3d691bbc3 /drivers/char
parentda3c6c836fb1a0b9f08a7efabbfb7e31a0c816f7 (diff)
downloadlinux-3e2ccc7454510e0990104eaf6f24f34be121dabb.tar.xz
hwrng: ba431 - Use device-managed registration
Use device-managed registration, so we can delete the ba431_trng_remove. 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/ba431-rng.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index 410b50b05e21..4f514e24c79b 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -193,7 +193,7 @@ static int ba431_trng_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ba431);
- ret = hwrng_register(&ba431->rng);
+ ret = devm_hwrng_register(&pdev->dev, &ba431->rng);
if (ret) {
dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret);
return ret;
@@ -204,15 +204,6 @@ static int ba431_trng_probe(struct platform_device *pdev)
return 0;
}
-static int ba431_trng_remove(struct platform_device *pdev)
-{
- struct ba431_trng *ba431 = platform_get_drvdata(pdev);
-
- hwrng_unregister(&ba431->rng);
-
- return 0;
-}
-
static const struct of_device_id ba431_trng_dt_ids[] = {
{ .compatible = "silex-insight,ba431-rng", .data = NULL },
{ /* sentinel */ }
@@ -225,7 +216,6 @@ static struct platform_driver ba431_trng_driver = {
.of_match_table = ba431_trng_dt_ids,
},
.probe = ba431_trng_probe,
- .remove = ba431_trng_remove,
};
module_platform_driver(ba431_trng_driver);