diff mbox series

[-next,1/2] hwrng: bcm2835 - Add missing clk_disable_unprepare in bcm2835_rng_init

Message ID 20240803064923.337696-2-cuigaosheng1@huawei.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series Add missing clk_disable_unprepare | expand

Commit Message

cuigaosheng Aug. 3, 2024, 6:49 a.m. UTC
Add the missing clk_disable_unprepare() before return in
bcm2835_rng_init().

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 drivers/char/hw_random/bcm2835-rng.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefan Wahren Aug. 3, 2024, 9:53 a.m. UTC | #1
Am 03.08.24 um 08:49 schrieb Gaosheng Cui:
> Add the missing clk_disable_unprepare() before return in
> bcm2835_rng_init().
>
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
Thanks

This was introduced by e5f9f41d5e62 ("hwrng: bcm2835 - add reset
support"), but i'm not sure if this needs a fixes tag.

Best regards
Florian Fainelli Aug. 6, 2024, 5:58 p.m. UTC | #2
On 8/2/24 23:49, Gaosheng Cui wrote:
> Add the missing clk_disable_unprepare() before return in
> bcm2835_rng_init().
> 
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
diff mbox series

Patch

diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index b03e80300627..aa2b135e3ee2 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -94,8 +94,10 @@  static int bcm2835_rng_init(struct hwrng *rng)
 		return ret;
 
 	ret = reset_control_reset(priv->reset);
-	if (ret)
+	if (ret) {
+		clk_disable_unprepare(priv->clk);
 		return ret;
+	}
 
 	if (priv->mask_interrupts) {
 		/* mask the interrupt */