summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2014-02-27 09:00:09 +0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-03-10 16:13:35 +0400
commit0c0becd0269240cd832b7aac16fb9b48d067520e (patch)
tree598b10aab87baecc2dca130276ac3b4e5b16ea38 /drivers/char
parent4ea5d9998a9de1c85167582d3fd2760cacf40f7d (diff)
downloadlinux-0c0becd0269240cd832b7aac16fb9b48d067520e.tar.xz
hwrng: atmel - Use devm_clk_get()
Use devm_clk_get() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/atmel-rng.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index dfeddf2c00b7..851bc7e20ad2 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -63,13 +63,13 @@ static int atmel_trng_probe(struct platform_device *pdev)
if (IS_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))
return PTR_ERR(trng->clk);
ret = clk_enable(trng->clk);
if (ret)
- goto err_enable;
+ return ret;
writel(TRNG_KEY | 1, trng->base + TRNG_CR);
trng->rng.name = pdev->name;
@@ -85,9 +85,6 @@ static int atmel_trng_probe(struct platform_device *pdev)
err_register:
clk_disable(trng->clk);
-err_enable:
- clk_put(trng->clk);
-
return ret;
}
@@ -99,7 +96,6 @@ static int atmel_trng_remove(struct platform_device *pdev)
writel(TRNG_KEY, trng->base + TRNG_CR);
clk_disable(trng->clk);
- clk_put(trng->clk);
return 0;
}