summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>2016-08-28 14:19:12 +0530
committerHerbert Xu <herbert@gondor.apana.org.au>2016-08-31 23:00:49 +0800
commit98a3c465fe987f1e0ae87a50ce980d6560233285 (patch)
tree2ca053b3f231512ae38543b8b85c974f24bbe8a5 /drivers/char
parent68734bc9f58ee01f1b530394cc31d58e364125f6 (diff)
downloadblackbird-obmc-linux-98a3c465fe987f1e0ae87a50ce980d6560233285.tar.gz
blackbird-obmc-linux-98a3c465fe987f1e0ae87a50ce980d6560233285.zip
hwrng: tx4939 - Use devm_hwrng_register instead of hwrng_register
By using devm_hwrng_register instead of hwrng_register the .remove callback in platform_driver can be removed. This reduces a few lines in code. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/tx4939-rng.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/char/hw_random/tx4939-rng.c b/drivers/char/hw_random/tx4939-rng.c
index a7b694913416..1093583b579c 100644
--- a/drivers/char/hw_random/tx4939-rng.c
+++ b/drivers/char/hw_random/tx4939-rng.c
@@ -144,22 +144,13 @@ static int __init tx4939_rng_probe(struct platform_device *dev)
}
platform_set_drvdata(dev, rngdev);
- return hwrng_register(&rngdev->rng);
-}
-
-static int __exit tx4939_rng_remove(struct platform_device *dev)
-{
- struct tx4939_rng *rngdev = platform_get_drvdata(dev);
-
- hwrng_unregister(&rngdev->rng);
- return 0;
+ return devm_hwrng_register(&dev->dev, &rngdev->rng);
}
static struct platform_driver tx4939_rng_driver = {
.driver = {
.name = "tx4939-rng",
},
- .remove = tx4939_rng_remove,
};
module_platform_driver_probe(tx4939_rng_driver, tx4939_rng_probe);
OpenPOWER on IntegriCloud