diff options
Diffstat (limited to 'drivers/usb/gadget/printer.c')
-rw-r--r-- | drivers/usb/gadget/printer.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 271ef94668e7..00e5f19c75ba 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c @@ -89,8 +89,7 @@ struct printer_dev { u8 config; s8 interface; struct usb_ep *in_ep, *out_ep; - const struct usb_endpoint_descriptor - *in, *out; + struct list_head rx_reqs; /* List of free RX structs */ struct list_head rx_reqs_active; /* List of Active RX xfers */ struct list_head rx_buffers; /* List of completed xfers */ @@ -895,19 +894,20 @@ set_printer_interface(struct printer_dev *dev) { int result = 0; - dev->in = ep_desc(dev->gadget, &hs_ep_in_desc, &fs_ep_in_desc); + dev->in_ep->desc = ep_desc(dev->gadget, &hs_ep_in_desc, &fs_ep_in_desc); dev->in_ep->driver_data = dev; - dev->out = ep_desc(dev->gadget, &hs_ep_out_desc, &fs_ep_out_desc); + dev->out_ep->desc = ep_desc(dev->gadget, &hs_ep_out_desc, + &fs_ep_out_desc); dev->out_ep->driver_data = dev; - result = usb_ep_enable(dev->in_ep, dev->in); + result = usb_ep_enable(dev->in_ep); if (result != 0) { DBG(dev, "enable %s --> %d\n", dev->in_ep->name, result); goto done; } - result = usb_ep_enable(dev->out_ep, dev->out); + result = usb_ep_enable(dev->out_ep); if (result != 0) { DBG(dev, "enable %s --> %d\n", dev->in_ep->name, result); goto done; @@ -918,8 +918,8 @@ done: if (result != 0) { (void) usb_ep_disable(dev->in_ep); (void) usb_ep_disable(dev->out_ep); - dev->in = NULL; - dev->out = NULL; + dev->in_ep->desc = NULL; + dev->out_ep->desc = NULL; } /* caller is responsible for cleanup on error */ @@ -933,12 +933,14 @@ static void printer_reset_interface(struct printer_dev *dev) DBG(dev, "%s\n", __func__); - if (dev->in) + if (dev->in_ep->desc) usb_ep_disable(dev->in_ep); - if (dev->out) + if (dev->out_ep->desc) usb_ep_disable(dev->out_ep); + dev->in_ep->desc = NULL; + dev->out_ep->desc = NULL; dev->interface = -1; } @@ -1104,9 +1106,9 @@ static void printer_soft_reset(struct printer_dev *dev) list_add(&req->list, &dev->tx_reqs); } - if (usb_ep_enable(dev->in_ep, dev->in)) + if (usb_ep_enable(dev->in_ep)) DBG(dev, "Failed to enable USB in_ep\n"); - if (usb_ep_enable(dev->out_ep, dev->out)) + if (usb_ep_enable(dev->out_ep)) DBG(dev, "Failed to enable USB out_ep\n"); wake_up_interruptible(&dev->rx_wait); |