Skip to content

Commit

Permalink
hwrng: iproc-rng200 - make use of devm_hwrng_register
Browse files Browse the repository at this point in the history
This allows us to get rid of driver's remove() method.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Dmitry Torokhov authored and Herbert Xu committed Mar 16, 2015
1 parent ef0a1b2 commit 73b3862
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions drivers/char/hw_random/iproc-rng200.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,29 +208,17 @@ static int iproc_rng200_probe(struct platform_device *pdev)
priv->rng.cleanup = iproc_rng200_cleanup,

/* Register driver */
ret = hwrng_register(&priv->rng);
ret = devm_hwrng_register(dev, &priv->rng);
if (ret) {
dev_err(dev, "hwrng registration failed\n");
return ret;
}

platform_set_drvdata(pdev, priv);

dev_info(dev, "hwrng registered\n");

return 0;
}

static int iproc_rng200_remove(struct platform_device *pdev)
{
struct iproc_rng200_dev *priv = platform_get_drvdata(pdev);

/* Unregister driver */
hwrng_unregister(&priv->rng);

return 0;
}

static const struct of_device_id iproc_rng200_of_match[] = {
{ .compatible = "brcm,iproc-rng200", },
{},
Expand All @@ -243,7 +231,6 @@ static struct platform_driver iproc_rng200_driver = {
.of_match_table = iproc_rng200_of_match,
},
.probe = iproc_rng200_probe,
.remove = iproc_rng200_remove,
};
module_platform_driver(iproc_rng200_driver);

Expand Down

0 comments on commit 73b3862

Please sign in to comment.