Skip to content

Commit

Permalink
USB: cdc-wdm: kill the now unnecessary bMaxPacketSize0 field and udev…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Bjørn Mork authored and Greg Kroah-Hartman committed Jan 24, 2012
1 parent 8457d99 commit 8143a89
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ struct wdm_device {
u16 bufsize;
u16 wMaxCommand;
u16 wMaxPacketSize;
u16 bMaxPacketSize0;
__le16 inum;
int reslength;
int length;
Expand Down Expand Up @@ -597,7 +596,6 @@ static void wdm_rxwork(struct work_struct *work)
static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
int rv = -EINVAL;
struct usb_device *udev = interface_to_usbdev(intf);
struct wdm_device *desc;
struct usb_host_interface *iface;
struct usb_endpoint_descriptor *ep;
Expand Down Expand Up @@ -657,7 +655,6 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
goto err;

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

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

usb_fill_control_urb(
desc->response,
interface_to_usbdev(desc->intf),
interface_to_usbdev(intf),
/* using common endpoint 0 */
usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
(unsigned char *)desc->irq,
Expand Down

0 comments on commit 8143a89

Please sign in to comment.