Commit 15c8e267 authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Kalle Valo

wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()

rtw_mac_power_switch() calls rtw_pwr_seq_parser() which can return
-EINVAL, -EBUSY or 0. Propagate the original error code instead of
unconditionally returning -EINVAL in case of an error.

Fixes: e3037485 ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230226221004.138331-3-martin.blumenstingl@googlemail.com
parent b7ed9fa2
...@@ -250,6 +250,7 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on) ...@@ -250,6 +250,7 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
const struct rtw_pwr_seq_cmd **pwr_seq; const struct rtw_pwr_seq_cmd **pwr_seq;
u8 rpwm; u8 rpwm;
bool cur_pwr; bool cur_pwr;
int ret;
if (rtw_chip_wcpu_11ac(rtwdev)) { if (rtw_chip_wcpu_11ac(rtwdev)) {
rpwm = rtw_read8(rtwdev, rtwdev->hci.rpwm_addr); rpwm = rtw_read8(rtwdev, rtwdev->hci.rpwm_addr);
...@@ -273,8 +274,9 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on) ...@@ -273,8 +274,9 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
return -EALREADY; return -EALREADY;
pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq; pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq;
if (rtw_pwr_seq_parser(rtwdev, pwr_seq)) ret = rtw_pwr_seq_parser(rtwdev, pwr_seq);
return -EINVAL; if (ret)
return ret;
if (pwr_on) if (pwr_on)
set_bit(RTW_FLAG_POWERON, rtwdev->flags); set_bit(RTW_FLAG_POWERON, rtwdev->flags);
......
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