summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2014-02-27 14:04:28 +0900
committerHerbert Xu <herbert@gondor.apana.org.au>2014-03-10 20:13:37 +0800
commit0c0aa8446433849f19761ebb7cd2f58fde387a04 (patch)
tree20bd0690134b1818b948281286db3d329af15145
parent0574bce9691f238f3351b28c27de337d4519d595 (diff)
downloadop-kernel-dev-0c0aa8446433849f19761ebb7cd2f58fde387a04.zip
op-kernel-dev-0c0aa8446433849f19761ebb7cd2f58fde387a04.tar.gz
hwrng: pixocell - Use devm_clk_get()
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>
-rw-r--r--drivers/char/hw_random/picoxcell-rng.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/char/hw_random/picoxcell-rng.c b/drivers/char/hw_random/picoxcell-rng.c
index c03beee..eab5448 100644
--- a/drivers/char/hw_random/picoxcell-rng.c
+++ b/drivers/char/hw_random/picoxcell-rng.c
@@ -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);
@@ -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();
@@ -132,9 +132,6 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
err_register:
clk_disable(rng_clk);
-err_enable:
- clk_put(rng_clk);
-
return ret;
}
@@ -142,7 +139,6 @@ static int picoxcell_trng_remove(struct platform_device *pdev)
{
hwrng_unregister(&picoxcell_trng);
clk_disable(rng_clk);
- clk_put(rng_clk);
return 0;
}
OpenPOWER on IntegriCloud