Commit 04b7d704 authored by Vaishali Thakkar's avatar Vaishali Thakkar Committed by Herbert Xu

hwrng: octeon - Use devm_hwrng_register

Use resource managed function devm_hwrng_register instead of
hwrng_register to make the error-path simpler. Also, remove
octeon_rng_remove as it is now redundant.
Signed-off-by: default avatarVaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a2712e6c
...@@ -96,7 +96,7 @@ static int octeon_rng_probe(struct platform_device *pdev) ...@@ -96,7 +96,7 @@ static int octeon_rng_probe(struct platform_device *pdev)
rng->ops = ops; rng->ops = ops;
platform_set_drvdata(pdev, &rng->ops); platform_set_drvdata(pdev, &rng->ops);
ret = hwrng_register(&rng->ops); ret = devm_hwrng_register(&pdev->dev, &rng->ops);
if (ret) if (ret)
return -ENOENT; return -ENOENT;
...@@ -105,21 +105,11 @@ static int octeon_rng_probe(struct platform_device *pdev) ...@@ -105,21 +105,11 @@ static int octeon_rng_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int octeon_rng_remove(struct platform_device *pdev)
{
struct hwrng *rng = platform_get_drvdata(pdev);
hwrng_unregister(rng);
return 0;
}
static struct platform_driver octeon_rng_driver = { static struct platform_driver octeon_rng_driver = {
.driver = { .driver = {
.name = "octeon_rng", .name = "octeon_rng",
}, },
.probe = octeon_rng_probe, .probe = octeon_rng_probe,
.remove = octeon_rng_remove,
}; };
module_platform_driver(octeon_rng_driver); module_platform_driver(octeon_rng_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment