diff mbox series

[v1,wireless-next,1/2] wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()

Message ID 20230226221004.138331-2-martin.blumenstingl@googlemail.com
State New
Headers show
Series wifi: rtw88: two small error propagation fixes | expand

Commit Message

Martin Blumenstingl Feb. 26, 2023, 10:10 p.m. UTC
rtw_pwr_seq_parser() calls rtw_sub_pwr_seq_parser() which can either
return -EBUSY, -EINVAL or 0. Propagate the original error code instead
of unconditionally returning -EBUSY in case of an error.

Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/wireless/realtek/rtw88/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ping-Ke Shih March 1, 2023, 1:51 a.m. UTC | #1
> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Sent: Monday, February 27, 2023 6:10 AM
> To: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; kvalo@kernel.org; tony0620emma@gmail.com;
> Ping-Ke Shih <pkshih@realtek.com>; Neo Jou <neojou@gmail.com>; Martin Blumenstingl
> <martin.blumenstingl@googlemail.com>
> Subject: [PATCH v1 wireless-next 1/2] wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()
> 
> rtw_pwr_seq_parser() calls rtw_sub_pwr_seq_parser() which can either
> return -EBUSY, -EINVAL or 0. Propagate the original error code instead
> of unconditionally returning -EBUSY in case of an error.
> 
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  drivers/net/wireless/realtek/rtw88/mac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
> index 1c9530a0eb69..4749d75fefee 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac.c
> @@ -236,7 +236,7 @@ static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
> 
>                 ret = rtw_sub_pwr_seq_parser(rtwdev, intf_mask, cut_mask, cmd);
>                 if (ret)
> -                       return -EBUSY;
> +                       return ret;
> 
>                 idx++;
>         } while (1);
> --
> 2.39.2
Kalle Valo March 6, 2023, 10:09 a.m. UTC | #2
Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:

> rtw_pwr_seq_parser() calls rtw_sub_pwr_seq_parser() which can either
> return -EBUSY, -EINVAL or 0. Propagate the original error code instead
> of unconditionally returning -EBUSY in case of an error.
> 
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>

2 patches applied to wireless-next.git, thanks.

b7ed9fa2cb76 wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()
15c8e267dfa6 wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
index 1c9530a0eb69..4749d75fefee 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -236,7 +236,7 @@  static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
 
 		ret = rtw_sub_pwr_seq_parser(rtwdev, intf_mask, cut_mask, cmd);
 		if (ret)
-			return -EBUSY;
+			return ret;
 
 		idx++;
 	} while (1);