Skip to content

Commit eaecce1

Browse files
tmlindherbertx
authored andcommitted
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 <[email protected]> Cc: Adam Ford <[email protected]> Cc: Pali Rohár <[email protected]> Cc: Sebastian Reichel <[email protected]> Cc: Tero Kristo <[email protected]> Fixes: 1c6b7c2 ("hwrng: OMAP3 ROM Random Number Generator support") Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 0c0ef9e commit eaecce1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/char/hw_random/omap3-rom-rng.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ static int omap3_rom_rng_remove(struct platform_device *pdev)
127127
{
128128
cancel_delayed_work_sync(&idle_work);
129129
hwrng_unregister(&omap3_rom_rng_ops);
130-
clk_disable_unprepare(rng_clk);
130+
if (!rng_idle)
131+
clk_disable_unprepare(rng_clk);
131132
return 0;
132133
}
133134

0 commit comments

Comments
 (0)