2020-11-13 07:49:59

by Xu Wang

[permalink] [raw]
Subject: [PATCH] rtc: brcmstb-waketimer: Remove redundant null check before clk_disable_unprepare

Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <[email protected]>
---
drivers/rtc/rtc-brcmstb-waketimer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c
index 4fee57c51280..375a9987a1d6 100644
--- a/drivers/rtc/rtc-brcmstb-waketimer.c
+++ b/drivers/rtc/rtc-brcmstb-waketimer.c
@@ -264,8 +264,7 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev)
unregister_reboot_notifier(&timer->reboot_notifier);

err_clk:
- if (timer->clk)
- clk_disable_unprepare(timer->clk);
+ clk_disable_unprepare(timer->clk);

return ret;
}
--
2.17.1


2020-11-13 23:15:41

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] rtc: brcmstb-waketimer: Remove redundant null check before clk_disable_unprepare

On 11/12/20 11:45 PM, Xu Wang wrote:
> Because clk_disable_unprepare() already checked NULL clock parameter,
> so the additional check is unnecessary, just remove it.
>
> Signed-off-by: Xu Wang <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian

2020-11-14 22:56:51

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH] rtc: brcmstb-waketimer: Remove redundant null check before clk_disable_unprepare

On Fri, 13 Nov 2020 07:45:38 +0000, Xu Wang wrote:
> Because clk_disable_unprepare() already checked NULL clock parameter,
> so the additional check is unnecessary, just remove it.

Applied, thanks!

[1/1] rtc: brcmstb-waketimer: Remove redundant null check before clk_disable_unprepare
commit: 910d002d84df21da61cadba92dd510ece5e46312

Best regards,
--
Alexandre Belloni <[email protected]>