hwrng: octeon - Use devm_hwrng_register
authorVaishali Thakkar <vthakkar1994@gmail.com>
Thu, 10 Sep 2015 06:02:26 +0000 (11:32 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 21 Sep 2015 14:00:38 +0000 (22:00 +0800)
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: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/octeon-rng.c

index 6234a4a19b5690235b7b12cd916a88006ae888a0..8c78aa0904925728404b49aedda73a212330cb3a 100644 (file)
@@ -96,7 +96,7 @@ static int octeon_rng_probe(struct platform_device *pdev)
        rng->ops = ops;
 
        platform_set_drvdata(pdev, &rng->ops);
-       ret = hwrng_register(&rng->ops);
+       ret = devm_hwrng_register(&pdev->dev, &rng->ops);
        if (ret)
                return -ENOENT;
 
@@ -105,21 +105,11 @@ static int octeon_rng_probe(struct platform_device *pdev)
        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 = {
        .driver = {
                .name           = "octeon_rng",
        },
        .probe          = octeon_rng_probe,
-       .remove         = octeon_rng_remove,
 };
 
 module_platform_driver(octeon_rng_driver);