diff mbox series

[RESEND.] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO

Message ID 1E6ABDEA91ADAB1A+20241218090833.140045-1-wangyuli@uniontech.com
State Superseded
Headers show
Series [RESEND.] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO | expand

Commit Message

WangYuli Dec. 18, 2024, 9:08 a.m. UTC
When initializing the network card, unplugging the device will
trigger an -EPROTO error, resulting in a flood of error messages
being printed frantically.

Co-developed-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 drivers/net/wireless/mediatek/mt76/usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

WangYuli Dec. 24, 2024, 9:01 a.m. UTC | #1
On 2024/12/19 23:23, Alexander Lobakin wrote:
> So you need to add the correct tree and/or subject prefix and specify
> "Fixes:" tag with the commit this change fixes.
>
>> ...
> I'm not a wireless expert, from my PoV sounds good. Just describe
> everything in details in the commit message, so that it will be clear
> for everyone.

Hi, I have attached the new patch as requested for your review.

Link: 
https://lore.kernel.org/all/BA065B146422EE5B+20241224085244.629015-1-wangyuli@uniontech.com/ 


Please let me know if you have any questions.


Thanks,
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index 58ff06823389..f9e67b8c3b3c 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -33,9 +33,9 @@  int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, u8 req_type,
 
 		ret = usb_control_msg(udev, pipe, req, req_type, val,
 				      offset, buf, len, MT_VEND_REQ_TOUT_MS);
-		if (ret == -ENODEV)
+		if (ret == -ENODEV || ret == -EPROTO)
 			set_bit(MT76_REMOVED, &dev->phy.state);
-		if (ret >= 0 || ret == -ENODEV)
+		if (ret >= 0 || ret == -ENODEV || ret == -EPROTO)
 			return ret;
 		usleep_range(5000, 10000);
 	}