summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2019-09-14 14:02:56 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2019-10-05 01:06:11 +1000
commiteaecce12f5f0d2c35d278e41e1bc4522393861ab (patch)
treec252bd37be51c0cb005c78e28067ca7f2ea8f310 /drivers/char
parent0c0ef9ea6f3f0d5979dc7b094b0a184c1a94716b (diff)
hwrng: omap3-rom - Call clk_disable_unprepare() on exit only if not idled
When unloading omap3-rom-rng, we'll get the following: WARNING: CPU: 0 PID: 100 at drivers/clk/clk.c:948 clk_core_disable This is because the clock may be already disabled by omap3_rom_rng_idle(). Let's fix the issue by checking for rng_idle on exit. Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Adam Ford <aford173@gmail.com> Cc: Pali Rohár <pali.rohar@gmail.com> Cc: Sebastian Reichel <sre@kernel.org> Cc: Tero Kristo <t-kristo@ti.com> Fixes: 1c6b7c2108bd ("hwrng: OMAP3 ROM Random Number Generator support") Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/omap3-rom-rng.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c
index 34e10f05545a..8df3cad7c97a 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -127,7 +127,8 @@ static int omap3_rom_rng_remove(struct platform_device *pdev)
{
cancel_delayed_work_sync(&idle_work);
hwrng_unregister(&omap3_rom_rng_ops);
- clk_disable_unprepare(rng_clk);
+ if (!rng_idle)
+ clk_disable_unprepare(rng_clk);
return 0;
}