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

hwrng: atmel - Use devm_clk_get()

Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarPeter Korsgaard <peter@korsgaard.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 4ea5d999
...@@ -63,13 +63,13 @@ static int atmel_trng_probe(struct platform_device *pdev) ...@@ -63,13 +63,13 @@ static int atmel_trng_probe(struct platform_device *pdev)
if (IS_ERR(trng->base)) if (IS_ERR(trng->base))
return PTR_ERR(trng->base); return PTR_ERR(trng->base);
trng->clk = clk_get(&pdev->dev, NULL); trng->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(trng->clk)) if (IS_ERR(trng->clk))
return PTR_ERR(trng->clk); return PTR_ERR(trng->clk);
ret = clk_enable(trng->clk); ret = clk_enable(trng->clk);
if (ret) if (ret)
goto err_enable; return ret;
writel(TRNG_KEY | 1, trng->base + TRNG_CR); writel(TRNG_KEY | 1, trng->base + TRNG_CR);
trng->rng.name = pdev->name; trng->rng.name = pdev->name;
...@@ -85,9 +85,6 @@ static int atmel_trng_probe(struct platform_device *pdev) ...@@ -85,9 +85,6 @@ static int atmel_trng_probe(struct platform_device *pdev)
err_register: err_register:
clk_disable(trng->clk); clk_disable(trng->clk);
err_enable:
clk_put(trng->clk);
return ret; return ret;
} }
...@@ -99,7 +96,6 @@ static int atmel_trng_remove(struct platform_device *pdev) ...@@ -99,7 +96,6 @@ static int atmel_trng_remove(struct platform_device *pdev)
writel(TRNG_KEY, trng->base + TRNG_CR); writel(TRNG_KEY, trng->base + TRNG_CR);
clk_disable(trng->clk); clk_disable(trng->clk);
clk_put(trng->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