Skip to content

Commit

Permalink
hwrng: timeriomem - Use device-managed registration API
Browse files Browse the repository at this point in the history
Use devm_hwrng_register to get rid of manual unregistration.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Tian Tao authored and Herbert Xu committed Feb 10, 2021
1 parent 4cf0806 commit 0de9dc8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/char/hw_random/timeriomem-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int timeriomem_rng_probe(struct platform_device *pdev)
priv->present = 1;
complete(&priv->completion);

err = hwrng_register(&priv->rng_ops);
err = devm_hwrng_register(&pdev->dev, &priv->rng_ops);
if (err) {
dev_err(&pdev->dev, "problem registering\n");
return err;
Expand All @@ -185,7 +185,6 @@ static int timeriomem_rng_remove(struct platform_device *pdev)
{
struct timeriomem_rng_private *priv = platform_get_drvdata(pdev);

hwrng_unregister(&priv->rng_ops);
hrtimer_cancel(&priv->timer);

return 0;
Expand Down

0 comments on commit 0de9dc8

Please sign in to comment.