diff mbox

[net-next] ath10k: Remove useless test before clk_disable_unprepare

Message ID 20180516105454.30212-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Commit cf3c0ae6a32b5c3bb19b07d48dff646fc3896e51
Delegated to: Kalle Valo
Headers show

Commit Message

Yue Haibing May 16, 2018, 10:54 a.m. UTC
clk_disable_unprepare() already checks that the clock pointer is valid.
No need to test it before calling it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/ath/ath10k/ahb.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Kalle Valo May 16, 2018, 11:42 a.m. UTC | #1
YueHaibing <yuehaibing@huawei.com> writes:

> clk_disable_unprepare() already checks that the clock pointer is valid.
> No need to test it before calling it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Just a note that ath10k patches are applied to my ath.git tree, not to
net-next. So adding net-next to the subject is wrong, but no need to
resend just because of that.
Yue Haibing May 16, 2018, 12:10 p.m. UTC | #2
On 2018/5/16 19:42, Kalle Valo wrote:
> YueHaibing <yuehaibing@huawei.com> writes:
> 
>> clk_disable_unprepare() already checks that the clock pointer is valid.
>> No need to test it before calling it.
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Just a note that ath10k patches are applied to my ath.git tree, not to
> net-next. So adding net-next to the subject is wrong, but no need to
> resend just because of that.
> 

OK, got it, thank you
Kalle Valo May 25, 2018, 10:04 a.m. UTC | #3
YueHaibing <yuehaibing@huawei.com> wrote:

> clk_disable_unprepare() already checks that the clock pointer is valid.
> No need to test it before calling it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

cf3c0ae6a32b ath10k: remove useless test before clk_disable_unprepare
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c
index 35d1049..fa39fff 100644
--- a/drivers/net/wireless/ath/ath10k/ahb.c
+++ b/drivers/net/wireless/ath/ath10k/ahb.c
@@ -180,14 +180,11 @@  static void ath10k_ahb_clock_disable(struct ath10k *ar)
 {
 	struct ath10k_ahb *ar_ahb = ath10k_ahb_priv(ar);
 
-	if (!IS_ERR_OR_NULL(ar_ahb->cmd_clk))
-		clk_disable_unprepare(ar_ahb->cmd_clk);
+	clk_disable_unprepare(ar_ahb->cmd_clk);
 
-	if (!IS_ERR_OR_NULL(ar_ahb->ref_clk))
-		clk_disable_unprepare(ar_ahb->ref_clk);
+	clk_disable_unprepare(ar_ahb->ref_clk);
 
-	if (!IS_ERR_OR_NULL(ar_ahb->rtc_clk))
-		clk_disable_unprepare(ar_ahb->rtc_clk);
+	clk_disable_unprepare(ar_ahb->rtc_clk);
 }
 
 static int ath10k_ahb_rst_ctrl_init(struct ath10k *ar)