Skip to content

Commit 8143a89

Browse files
bmorkgregkh
authored andcommitted
USB: cdc-wdm: kill the now unnecessary bMaxPacketSize0 field and udev variable
We don't need bMaxPacketSize0, and keeping all these different size fields around will only cause us to use the wrong one. Seems the udev variable was only used for getting bMaxPacketSize0. We could have used it for the usb_fill_*_urb() calls, but as it wasn't before - why start now? Instead make the interface_to_usbdev() calls consistent. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 8457d99 commit 8143a89

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/usb/class/cdc-wdm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ struct wdm_device {
8080
u16 bufsize;
8181
u16 wMaxCommand;
8282
u16 wMaxPacketSize;
83-
u16 bMaxPacketSize0;
8483
__le16 inum;
8584
int reslength;
8685
int length;
@@ -597,7 +596,6 @@ static void wdm_rxwork(struct work_struct *work)
597596
static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
598597
{
599598
int rv = -EINVAL;
600-
struct usb_device *udev = interface_to_usbdev(intf);
601599
struct wdm_device *desc;
602600
struct usb_host_interface *iface;
603601
struct usb_endpoint_descriptor *ep;
@@ -657,7 +655,6 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
657655
goto err;
658656

659657
desc->wMaxPacketSize = usb_endpoint_maxp(ep);
660-
desc->bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0;
661658

662659
desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
663660
if (!desc->orq)
@@ -709,7 +706,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
709706

710707
usb_fill_control_urb(
711708
desc->response,
712-
interface_to_usbdev(desc->intf),
709+
interface_to_usbdev(intf),
713710
/* using common endpoint 0 */
714711
usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
715712
(unsigned char *)desc->irq,

0 commit comments

Comments
 (0)