diff mbox series

rtc: brcmstb-waketimer: add missed clk_disable_unprepare

Message ID 20191104155019.9053-1-hslester96@gmail.com (mailing list archive)
State New, archived
Headers show
Series rtc: brcmstb-waketimer: add missed clk_disable_unprepare | expand

Commit Message

Chuhong Yuan Nov. 4, 2019, 3:50 p.m. UTC
This driver forgets to disable and unprepare clock when remove.
Add a call to clk_disable_unprepare to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/rtc/rtc-brcmstb-waketimer.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Florian Fainelli Nov. 4, 2019, 5:36 p.m. UTC | #1
On 11/4/19 7:50 AM, Chuhong Yuan wrote:
> This driver forgets to disable and unprepare clock when remove.
> Add a call to clk_disable_unprepare to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>

This looks fine, you do not need to check for timer->clk, since the
clk_* APIs do that, and we made sure in the probe function that we would
not be passing a timer->clk handle which is valid.

Also feel free to add:

Fixes: c4f07ecee22e ("rtc: brcmstb-waketimer: Add Broadcom STB wake-timer")

Thank you
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c
index 3e9800f9878a..06b2bdde584a 100644
--- a/drivers/rtc/rtc-brcmstb-waketimer.c
+++ b/drivers/rtc/rtc-brcmstb-waketimer.c
@@ -277,6 +277,8 @@  static int brcmstb_waketmr_remove(struct platform_device *pdev)
 	struct brcmstb_waketmr *timer = dev_get_drvdata(&pdev->dev);
 
 	unregister_reboot_notifier(&timer->reboot_notifier);
+	if (timer->clk)
+		clk_disable_unprepare(timer->clk);
 
 	return 0;
 }