aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/inode.c')
-rw-r--r--drivers/usb/gadget/inode.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index a56876aaf76c..1b240990448f 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -832,14 +832,16 @@ ep_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
832 switch (data->dev->gadget->speed) { 832 switch (data->dev->gadget->speed) {
833 case USB_SPEED_LOW: 833 case USB_SPEED_LOW:
834 case USB_SPEED_FULL: 834 case USB_SPEED_FULL:
835 value = usb_ep_enable (ep, &data->desc); 835 ep->desc = &data->desc;
836 value = usb_ep_enable(ep);
836 if (value == 0) 837 if (value == 0)
837 data->state = STATE_EP_ENABLED; 838 data->state = STATE_EP_ENABLED;
838 break; 839 break;
839#ifdef CONFIG_USB_GADGET_DUALSPEED 840#ifdef CONFIG_USB_GADGET_DUALSPEED
840 case USB_SPEED_HIGH: 841 case USB_SPEED_HIGH:
841 /* fails if caller didn't provide that descriptor... */ 842 /* fails if caller didn't provide that descriptor... */
842 value = usb_ep_enable (ep, &data->hs_desc); 843 ep->desc = &data->hs_desc;
844 value = usb_ep_enable(ep);
843 if (value == 0) 845 if (value == 0)
844 data->state = STATE_EP_ENABLED; 846 data->state = STATE_EP_ENABLED;
845 break; 847 break;
@@ -1345,7 +1347,7 @@ static void make_qualifier (struct dev_data *dev)
1345 qual.bDeviceProtocol = desc->bDeviceProtocol; 1347 qual.bDeviceProtocol = desc->bDeviceProtocol;
1346 1348
1347 /* assumes ep0 uses the same value for both speeds ... */ 1349 /* assumes ep0 uses the same value for both speeds ... */
1348 qual.bMaxPacketSize0 = desc->bMaxPacketSize0; 1350 qual.bMaxPacketSize0 = dev->gadget->ep0->maxpacket;
1349 1351
1350 qual.bNumConfigurations = 1; 1352 qual.bNumConfigurations = 1;
1351 qual.bRESERVED = 0; 1353 qual.bRESERVED = 0;
@@ -1402,7 +1404,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1402 } 1404 }
1403 1405
1404 dev->state = STATE_DEV_CONNECTED; 1406 dev->state = STATE_DEV_CONNECTED;
1405 dev->dev->bMaxPacketSize0 = gadget->ep0->maxpacket;
1406 1407
1407 INFO (dev, "connected\n"); 1408 INFO (dev, "connected\n");
1408 event = next_event (dev, GADGETFS_CONNECT); 1409 event = next_event (dev, GADGETFS_CONNECT);
@@ -1430,6 +1431,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1430 1431
1431 case USB_DT_DEVICE: 1432 case USB_DT_DEVICE:
1432 value = min (w_length, (u16) sizeof *dev->dev); 1433 value = min (w_length, (u16) sizeof *dev->dev);
1434 dev->dev->bMaxPacketSize0 = dev->gadget->ep0->maxpacket;
1433 req->buf = dev->dev; 1435 req->buf = dev->dev;
1434 break; 1436 break;
1435#ifdef CONFIG_USB_GADGET_DUALSPEED 1437#ifdef CONFIG_USB_GADGET_DUALSPEED
@@ -1710,7 +1712,6 @@ gadgetfs_bind (struct usb_gadget *gadget)
1710 set_gadget_data (gadget, dev); 1712 set_gadget_data (gadget, dev);
1711 dev->gadget = gadget; 1713 dev->gadget = gadget;
1712 gadget->ep0->driver_data = dev; 1714 gadget->ep0->driver_data = dev;
1713 dev->dev->bMaxPacketSize0 = gadget->ep0->maxpacket;
1714 1715
1715 /* preallocate control response and buffer */ 1716 /* preallocate control response and buffer */
1716 dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL); 1717 dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL);