Commit 0c0aa844 authored by Jingoo Han's avatar Jingoo Han Committed by Herbert Xu

hwrng: pixocell - Use devm_clk_get()

Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0574bce9
...@@ -108,7 +108,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev) ...@@ -108,7 +108,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
if (IS_ERR(rng_base)) if (IS_ERR(rng_base))
return PTR_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)) { if (IS_ERR(rng_clk)) {
dev_warn(&pdev->dev, "no clk\n"); dev_warn(&pdev->dev, "no clk\n");
return PTR_ERR(rng_clk); return PTR_ERR(rng_clk);
...@@ -117,7 +117,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev) ...@@ -117,7 +117,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
ret = clk_enable(rng_clk); ret = clk_enable(rng_clk);
if (ret) { if (ret) {
dev_warn(&pdev->dev, "unable to enable clk\n"); dev_warn(&pdev->dev, "unable to enable clk\n");
goto err_enable; return ret;
} }
picoxcell_trng_start(); picoxcell_trng_start();
...@@ -132,9 +132,6 @@ static int picoxcell_trng_probe(struct platform_device *pdev) ...@@ -132,9 +132,6 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
err_register: err_register:
clk_disable(rng_clk); clk_disable(rng_clk);
err_enable:
clk_put(rng_clk);
return ret; return ret;
} }
...@@ -142,7 +139,6 @@ static int picoxcell_trng_remove(struct platform_device *pdev) ...@@ -142,7 +139,6 @@ static int picoxcell_trng_remove(struct platform_device *pdev)
{ {
hwrng_unregister(&picoxcell_trng); hwrng_unregister(&picoxcell_trng);
clk_disable(rng_clk); clk_disable(rng_clk);
clk_put(rng_clk);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment