diff mbox series

[3/3,v4] wifi: rtw88: remove unused USB bulkout size set

Message ID 20230621092313.65965-3-dmantipov@yandex.ru (mailing list archive)
State Superseded
Delegated to: Kalle Valo
Headers show
Series [1/3,v4] wifi: rtw88: delete timer and free skb queue when unloading | expand

Commit Message

Dmitry Antipov June 21, 2023, 9:22 a.m. UTC
Drop no longer used 'bulkout_size' of 'struct rtw_usb' as well
as related macros from usb.h and leftovers in 'rtw_usb_parse()'.
This follows commit 462c8db6a011 ("wifi: rtw88: usb: drop
now unnecessary URB size check").

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
v4: remove all bulkout size leftovers (Ping-Ke Shih, Sascha Hauer)
---
 drivers/net/wireless/realtek/rtw88/usb.c | 17 -----------------
 drivers/net/wireless/realtek/rtw88/usb.h |  5 -----
 2 files changed, 22 deletions(-)

Comments

Sascha Hauer June 21, 2023, 9:30 a.m. UTC | #1
On Wed, Jun 21, 2023 at 12:22:15PM +0300, Dmitry Antipov wrote:
> Drop no longer used 'bulkout_size' of 'struct rtw_usb' as well
> as related macros from usb.h and leftovers in 'rtw_usb_parse()'.
> This follows commit 462c8db6a011 ("wifi: rtw88: usb: drop
> now unnecessary URB size check").
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

> ---
> v4: remove all bulkout size leftovers (Ping-Ke Shih, Sascha Hauer)
> ---
>  drivers/net/wireless/realtek/rtw88/usb.c | 17 -----------------
>  drivers/net/wireless/realtek/rtw88/usb.h |  5 -----
>  2 files changed, 22 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index 6862338b1d51..6423140c6005 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -141,7 +141,6 @@ static int rtw_usb_parse(struct rtw_dev *rtwdev,
>  	struct usb_host_interface *host_interface = &interface->altsetting[0];
>  	struct usb_interface_descriptor *interface_desc = &host_interface->desc;
>  	struct usb_endpoint_descriptor *endpoint;
> -	struct usb_device *usbd = interface_to_usbdev(interface);
>  	int num_out_pipes = 0;
>  	int i;
>  	u8 num;
> @@ -183,22 +182,6 @@ static int rtw_usb_parse(struct rtw_dev *rtwdev,
>  		}
>  	}
>  
> -	switch (usbd->speed) {
> -	case USB_SPEED_LOW:
> -	case USB_SPEED_FULL:
> -		rtwusb->bulkout_size = RTW_USB_FULL_SPEED_BULK_SIZE;
> -		break;
> -	case USB_SPEED_HIGH:
> -		rtwusb->bulkout_size = RTW_USB_HIGH_SPEED_BULK_SIZE;
> -		break;
> -	case USB_SPEED_SUPER:
> -		rtwusb->bulkout_size = RTW_USB_SUPER_SPEED_BULK_SIZE;
> -		break;
> -	default:
> -		rtw_err(rtwdev, "failed to detect usb speed\n");
> -		return -EINVAL;
> -	}
> -
>  	rtwdev->hci.bulkout_num = num_out_pipes;
>  
>  	if (num_out_pipes < 1 || num_out_pipes > 4) {
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.h b/drivers/net/wireless/realtek/rtw88/usb.h
> index fad998005ec8..86697a5c0103 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.h
> +++ b/drivers/net/wireless/realtek/rtw88/usb.h
> @@ -18,10 +18,6 @@
>  
>  #define RTW_USB_VENQT_CMD_IDX		0x00
>  
> -#define RTW_USB_SUPER_SPEED_BULK_SIZE	1024
> -#define RTW_USB_HIGH_SPEED_BULK_SIZE	512
> -#define RTW_USB_FULL_SPEED_BULK_SIZE	64
> -
>  #define RTW_USB_TX_SEL_HQ		BIT(0)
>  #define RTW_USB_TX_SEL_LQ		BIT(1)
>  #define RTW_USB_TX_SEL_NQ		BIT(2)
> @@ -73,7 +69,6 @@ struct rtw_usb {
>  	__le32 *usb_data;
>  	unsigned int usb_data_index;
>  
> -	u32 bulkout_size;
>  	u8 pipe_interrupt;
>  	u8 pipe_in;
>  	u8 out_ep[RTW_USB_EP_MAX];
> -- 
> 2.41.0
> 
>
Ping-Ke Shih June 21, 2023, 11:24 a.m. UTC | #2
On Wed, 2023-06-21 at 11:30 +0200, Sascha Hauer wrote:
> 
> On Wed, Jun 21, 2023 at 12:22:15PM +0300, Dmitry Antipov wrote:
> > Drop no longer used 'bulkout_size' of 'struct rtw_usb' as well
> > as related macros from usb.h and leftovers in 'rtw_usb_parse()'.
> > This follows commit 462c8db6a011 ("wifi: rtw88: usb: drop
> > now unnecessary URB size check").
> > 
> > Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> 
> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
> 

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

[...]
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
index 6862338b1d51..6423140c6005 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -141,7 +141,6 @@  static int rtw_usb_parse(struct rtw_dev *rtwdev,
 	struct usb_host_interface *host_interface = &interface->altsetting[0];
 	struct usb_interface_descriptor *interface_desc = &host_interface->desc;
 	struct usb_endpoint_descriptor *endpoint;
-	struct usb_device *usbd = interface_to_usbdev(interface);
 	int num_out_pipes = 0;
 	int i;
 	u8 num;
@@ -183,22 +182,6 @@  static int rtw_usb_parse(struct rtw_dev *rtwdev,
 		}
 	}
 
-	switch (usbd->speed) {
-	case USB_SPEED_LOW:
-	case USB_SPEED_FULL:
-		rtwusb->bulkout_size = RTW_USB_FULL_SPEED_BULK_SIZE;
-		break;
-	case USB_SPEED_HIGH:
-		rtwusb->bulkout_size = RTW_USB_HIGH_SPEED_BULK_SIZE;
-		break;
-	case USB_SPEED_SUPER:
-		rtwusb->bulkout_size = RTW_USB_SUPER_SPEED_BULK_SIZE;
-		break;
-	default:
-		rtw_err(rtwdev, "failed to detect usb speed\n");
-		return -EINVAL;
-	}
-
 	rtwdev->hci.bulkout_num = num_out_pipes;
 
 	if (num_out_pipes < 1 || num_out_pipes > 4) {
diff --git a/drivers/net/wireless/realtek/rtw88/usb.h b/drivers/net/wireless/realtek/rtw88/usb.h
index fad998005ec8..86697a5c0103 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.h
+++ b/drivers/net/wireless/realtek/rtw88/usb.h
@@ -18,10 +18,6 @@ 
 
 #define RTW_USB_VENQT_CMD_IDX		0x00
 
-#define RTW_USB_SUPER_SPEED_BULK_SIZE	1024
-#define RTW_USB_HIGH_SPEED_BULK_SIZE	512
-#define RTW_USB_FULL_SPEED_BULK_SIZE	64
-
 #define RTW_USB_TX_SEL_HQ		BIT(0)
 #define RTW_USB_TX_SEL_LQ		BIT(1)
 #define RTW_USB_TX_SEL_NQ		BIT(2)
@@ -73,7 +69,6 @@  struct rtw_usb {
 	__le32 *usb_data;
 	unsigned int usb_data_index;
 
-	u32 bulkout_size;
 	u8 pipe_interrupt;
 	u8 pipe_in;
 	u8 out_ep[RTW_USB_EP_MAX];