Commit ebe8e611 authored by Chin-Yen Lee's avatar Chin-Yen Lee Committed by Kalle Valo

rtw88: Fix return value of rtw_wow_check_fw_status

Clang warns that ret is used uninitialzed.
And we found that actually the return type should be "int" instead
of "bool".

Fixes: 44bc17f7 ("rtw88: support wowlan feature for 8822c")
Link: https://github.com/ClangBuiltLinux/linux/issues/850Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarChin-Yen Lee <timlee@realtek.com>
Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 577ddbee
...@@ -281,27 +281,26 @@ static void rtw_wow_rx_dma_start(struct rtw_dev *rtwdev) ...@@ -281,27 +281,26 @@ static void rtw_wow_rx_dma_start(struct rtw_dev *rtwdev)
rtw_write32_clr(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE); rtw_write32_clr(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE);
} }
static bool rtw_wow_check_fw_status(struct rtw_dev *rtwdev, bool wow_enable) static int rtw_wow_check_fw_status(struct rtw_dev *rtwdev, bool wow_enable)
{ {
bool ret;
/* wait 100ms for wow firmware to finish work */ /* wait 100ms for wow firmware to finish work */
msleep(100); msleep(100);
if (wow_enable) { if (wow_enable) {
if (!rtw_read8(rtwdev, REG_WOWLAN_WAKE_REASON)) if (rtw_read8(rtwdev, REG_WOWLAN_WAKE_REASON))
ret = 0; goto wow_fail;
} else { } else {
if (rtw_read32_mask(rtwdev, REG_FE1IMR, BIT_FS_RXDONE) == 0 && if (rtw_read32_mask(rtwdev, REG_FE1IMR, BIT_FS_RXDONE) ||
rtw_read32_mask(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE) == 0) rtw_read32_mask(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE))
ret = 0; goto wow_fail;
} }
if (ret) return 0;
rtw_err(rtwdev, "failed to check wow status %s\n",
wow_enable ? "enabled" : "disabled");
return ret; wow_fail:
rtw_err(rtwdev, "failed to check wow status %s\n",
wow_enable ? "enabled" : "disabled");
return -EBUSY;
} }
static void rtw_wow_fw_security_type_iter(struct ieee80211_hw *hw, static void rtw_wow_fw_security_type_iter(struct ieee80211_hw *hw,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment