Commit 21961efa authored by Boris Brezillon's avatar Boris Brezillon Committed by Herbert Xu

hwrng: atmel - use clk_prepapre_enable/_disable_unprepare

Use clk_prepare_enable/_disable_unprepare instead of clk_enable/disable
to work properly with the CCF.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.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 1e0bdad0
...@@ -67,7 +67,7 @@ static int atmel_trng_probe(struct platform_device *pdev) ...@@ -67,7 +67,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
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_prepare_enable(trng->clk);
if (ret) if (ret)
return ret; return ret;
...@@ -95,7 +95,7 @@ static int atmel_trng_remove(struct platform_device *pdev) ...@@ -95,7 +95,7 @@ static int atmel_trng_remove(struct platform_device *pdev)
hwrng_unregister(&trng->rng); hwrng_unregister(&trng->rng);
writel(TRNG_KEY, trng->base + TRNG_CR); writel(TRNG_KEY, trng->base + TRNG_CR);
clk_disable(trng->clk); clk_disable_unprepare(trng->clk);
return 0; return 0;
} }
...@@ -105,7 +105,7 @@ static int atmel_trng_suspend(struct device *dev) ...@@ -105,7 +105,7 @@ static int atmel_trng_suspend(struct device *dev)
{ {
struct atmel_trng *trng = dev_get_drvdata(dev); struct atmel_trng *trng = dev_get_drvdata(dev);
clk_disable(trng->clk); clk_disable_unprepare(trng->clk);
return 0; return 0;
} }
...@@ -114,7 +114,7 @@ static int atmel_trng_resume(struct device *dev) ...@@ -114,7 +114,7 @@ static int atmel_trng_resume(struct device *dev)
{ {
struct atmel_trng *trng = dev_get_drvdata(dev); struct atmel_trng *trng = dev_get_drvdata(dev);
return clk_enable(trng->clk); return clk_prepare_enable(trng->clk);
} }
static const struct dev_pm_ops atmel_trng_pm_ops = { static const struct dev_pm_ops atmel_trng_pm_ops = {
......
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