diff options
Diffstat (limited to 'drivers/usb/gadget/udc')
-rw-r--r-- | drivers/usb/gadget/udc/bcm63xx_udc.c | 16 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/core.c | 10 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/dummy_hcd.c | 16 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/fsl_udc_core.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/pxa27x_udc.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/trace.h | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/udc-xilinx.c | 2 |
7 files changed, 19 insertions, 36 deletions
diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 29f254793592..465ccd1104de 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -2385,10 +2385,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) goto out_uninit; } if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0, - dev_name(dev), udc) < 0) { - dev_err(dev, "error requesting IRQ #%d\n", irq); - goto out_uninit; - } + dev_name(dev), udc) < 0) + goto report_request_failure; /* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */ for (i = 0; i < BCM63XX_NUM_IUDMA; i++) { @@ -2398,10 +2396,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) goto out_uninit; } if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0, - dev_name(dev), &udc->iudma[i]) < 0) { - dev_err(dev, "error requesting IRQ #%d\n", irq); - goto out_uninit; - } + dev_name(dev), &udc->iudma[i]) < 0) + goto report_request_failure; } bcm63xx_udc_init_debugfs(udc); @@ -2413,6 +2409,10 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) out_uninit: bcm63xx_uninit_udc_hw(udc); return rc; + +report_request_failure: + dev_err(dev, "error requesting IRQ #%d\n", irq); + goto out_uninit; } /** diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 1b3efb14aec7..859d5b11ba4c 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -912,7 +912,7 @@ int usb_gadget_ep_match_desc(struct usb_gadget *gadget, return 0; /* "high bandwidth" works only at high speed */ - if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp(desc) & (3<<11)) + if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp_mult(desc) > 1) return 0; switch (type) { @@ -1417,7 +1417,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_unregister_driver); /* ------------------------------------------------------------------------- */ -static ssize_t usb_udc_srp_store(struct device *dev, +static ssize_t srp_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct usb_udc *udc = container_of(dev, struct usb_udc, dev); @@ -1427,9 +1427,9 @@ static ssize_t usb_udc_srp_store(struct device *dev, return n; } -static DEVICE_ATTR(srp, S_IWUSR, NULL, usb_udc_srp_store); +static DEVICE_ATTR_WO(srp); -static ssize_t usb_udc_softconn_store(struct device *dev, +static ssize_t soft_connect_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct usb_udc *udc = container_of(dev, struct usb_udc, dev); @@ -1453,7 +1453,7 @@ static ssize_t usb_udc_softconn_store(struct device *dev, return n; } -static DEVICE_ATTR(soft_connect, S_IWUSR, NULL, usb_udc_softconn_store); +static DEVICE_ATTR_WO(soft_connect); static ssize_t state_show(struct device *dev, struct device_attribute *attr, char *buf) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index d0128f92ec5a..e744d4b7bfed 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -925,20 +925,8 @@ static void dummy_udc_set_speed(struct usb_gadget *_gadget, struct dummy *dum; dum = gadget_dev_to_dummy(&_gadget->dev); - - if (mod_data.is_super_speed) - dum->gadget.speed = min_t(u8, USB_SPEED_SUPER, speed); - else if (mod_data.is_high_speed) - dum->gadget.speed = min_t(u8, USB_SPEED_HIGH, speed); - else - dum->gadget.speed = USB_SPEED_FULL; - + dum->gadget.speed = speed; dummy_udc_update_ep0(dum); - - if (dum->gadget.speed < speed) - dev_dbg(udc_dev(dum), "This device can perform faster" - " if you connect it to a %s port...\n", - usb_speed_string(speed)); } static int dummy_udc_start(struct usb_gadget *g, @@ -2193,8 +2181,6 @@ static int dummy_hub_control( USB_PORT_STAT_LOW_SPEED; break; default: - dum_hcd->dum->gadget.speed = - USB_SPEED_FULL; break; } } diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index d606d4f13098..e5b4ee96c4bf 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -1543,7 +1543,7 @@ static void ep0_req_complete(struct fsl_udc *udc, struct fsl_ep *ep0, udc->ep0_state = WAIT_FOR_SETUP; break; case WAIT_FOR_SETUP: - ERR("Unexpect ep0 packets\n"); + ERR("Unexpected ep0 packets\n"); break; default: ep0stall(udc); diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index be2761f1b3f5..fadcf2653c3d 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -979,8 +979,6 @@ static int write_fifo(struct pxa_ep *ep, struct pxa27x_request *req) max = ep->fifo_size; do { - is_short = 0; - udccsr = udc_ep_readl(ep, UDCCSR); if (udccsr & UDCCSR_PC) { ep_vdbg(ep, "Clearing Transmit Complete, udccsr=%x\n", @@ -1134,7 +1132,6 @@ static int pxa_ep_queue(struct usb_ep *_ep, struct usb_request *_req, if (unlikely(!_ep)) return -EINVAL; - dev = udc_usb_ep->dev; ep = udc_usb_ep->pxa_ep; if (unlikely(!ep)) return -EINVAL; diff --git a/drivers/usb/gadget/udc/trace.h b/drivers/usb/gadget/udc/trace.h index f07ddb3f4bb9..2d1f68b5ea76 100644 --- a/drivers/usb/gadget/udc/trace.h +++ b/drivers/usb/gadget/udc/trace.h @@ -225,6 +225,7 @@ DECLARE_EVENT_CLASS(udc_log_req, __field(unsigned, short_not_ok) __field(int, status) __field(int, ret) + __field(struct usb_request *, req) ), TP_fast_assign( snprintf(__get_str(name), UDC_TRACE_STR_MAX, "%s", ep->name); @@ -238,9 +239,10 @@ DECLARE_EVENT_CLASS(udc_log_req, __entry->short_not_ok = req->short_not_ok; __entry->status = req->status; __entry->ret = ret; + __entry->req = req; ), - TP_printk("%s: length %d/%d sgs %d/%d stream %d %s%s%s status %d --> %d", - __get_str(name), __entry->actual, __entry->length, + TP_printk("%s: req %p length %d/%d sgs %d/%d stream %d %s%s%s status %d --> %d", + __get_str(name),__entry->req, __entry->actual, __entry->length, __entry->num_mapped_sgs, __entry->num_sgs, __entry->stream_id, __entry->zero ? "Z" : "z", __entry->short_not_ok ? "S" : "s", diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index 7da2b9ce8cb3..6407e433bc78 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -963,10 +963,8 @@ static struct usb_request *xudc_ep_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct xusb_ep *ep = to_xusb_ep(_ep); - struct xusb_udc *udc; struct xusb_req *req; - udc = ep->udc; req = kzalloc(sizeof(*req), gfp_flags); if (!req) return NULL; |