Skip to content

Commit

Permalink
hwrng: pixocell - Use devm_clk_get()
Browse files Browse the repository at this point in the history
Use devm_clk_get() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Jingoo Han authored and Herbert Xu committed Mar 10, 2014
1 parent 0574bce commit 0c0aa84
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/char/hw_random/picoxcell-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
if (IS_ERR(rng_base))
return PTR_ERR(rng_base);

rng_clk = clk_get(&pdev->dev, NULL);
rng_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(rng_clk)) {
dev_warn(&pdev->dev, "no clk\n");
return PTR_ERR(rng_clk);
Expand All @@ -117,7 +117,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
ret = clk_enable(rng_clk);
if (ret) {
dev_warn(&pdev->dev, "unable to enable clk\n");
goto err_enable;
return ret;
}

picoxcell_trng_start();
Expand All @@ -132,17 +132,13 @@ static int picoxcell_trng_probe(struct platform_device *pdev)

err_register:
clk_disable(rng_clk);
err_enable:
clk_put(rng_clk);

return ret;
}

static int picoxcell_trng_remove(struct platform_device *pdev)
{
hwrng_unregister(&picoxcell_trng);
clk_disable(rng_clk);
clk_put(rng_clk);

return 0;
}
Expand Down

0 comments on commit 0c0aa84

Please sign in to comment.