@@ -429,7 +429,7 @@ int c67x00_urb_enqueue(struct usb_hcd *hcd,
return 0;
err_epdata:
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
err_not_linked:
spin_unlock_irqrestore(&c67x00->lock, flags);
kfree(urbp);
@@ -450,7 +450,7 @@ int c67x00_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
goto done;
c67x00_release_urb(c67x00, urb);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&c67x00->lock);
usb_hcd_giveback_urb(hcd, urb, status);
@@ -484,7 +484,7 @@ c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status)
list_del_init(&urbp->hep_node);
c67x00_release_urb(c67x00, urb);
- usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&c67x00->lock);
usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status);
spin_lock(&c67x00->lock);
@@ -707,7 +707,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* any errors get returned through the urb completion */
spin_lock_irq(&hcd_root_hub_lock);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
usb_hcd_giveback_urb(hcd, urb, status);
spin_unlock_irq(&hcd_root_hub_lock);
return 0;
@@ -753,7 +753,7 @@ void usb_hcd_poll_rh_status(struct usb_hcd *hcd)
urb->actual_length = length;
memcpy(urb->transfer_buffer, buffer, length);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
usb_hcd_giveback_urb(hcd, urb, status);
} else {
length = 0;
@@ -845,7 +845,7 @@ static int usb_rh_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
del_timer (&hcd->rh_timer);
if (urb == hcd->status_urb) {
hcd->status_urb = NULL;
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
usb_hcd_giveback_urb(hcd, urb, status);
}
}
@@ -1210,7 +1210,6 @@ EXPORT_SYMBOL_GPL(usb_hcd_check_unlink_urb);
/**
* usb_hcd_unlink_urb_from_ep - remove an URB from its endpoint queue
- * @hcd: host controller to which @urb was submitted
* @urb: URB being unlinked
*
* Host controller drivers should call this routine before calling
@@ -1218,7 +1217,7 @@ EXPORT_SYMBOL_GPL(usb_hcd_check_unlink_urb);
* interrupts must be disabled. The actions carried out here are required
* for URB completion.
*/
-void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb)
+void usb_hcd_unlink_urb_from_ep(struct urb *urb)
{
/* clear all state linking urb to this dev (and hcd) */
spin_lock(&hcd_urb_list_lock);
@@ -2221,7 +2221,7 @@ __acquires(fotg210->lock)
#endif
/* complete() can reenter this HCD */
- usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&fotg210->lock);
usb_hcd_giveback_urb(fotg210_to_hcd(fotg210), urb, status);
spin_lock(&fotg210->lock);
@@ -3043,7 +3043,7 @@ static int submit_async(struct fotg210_hcd *fotg210, struct urb *urb,
qh = qh_append_tds(fotg210, urb, qtd_list, epnum, &urb->ep->hcpriv);
if (unlikely(qh == NULL)) {
- usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
rc = -ENOMEM;
goto done;
}
@@ -3855,7 +3855,7 @@ static int intr_submit(struct fotg210_hcd *fotg210, struct urb *urb,
done:
if (unlikely(status))
- usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
done_not_linked:
spin_unlock_irqrestore(&fotg210->lock, flags);
if (status)
@@ -4553,14 +4553,14 @@ static int itd_submit(struct fotg210_hcd *fotg210, struct urb *urb,
status = -ESHUTDOWN;
goto done_not_linked;
}
- status = usb_hcd_link_urb_to_ep(fotg210_to_hcd(fotg210), urb);
+ status = usb_hcd_link_urb_to_ep(urb);
if (unlikely(status))
goto done_not_linked;
status = iso_stream_schedule(fotg210, urb, stream);
if (likely(status == 0))
itd_link_urb(fotg210, urb, fotg210->periodic_size << 3, stream);
else
- usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
done_not_linked:
spin_unlock_irqrestore(&fotg210->lock, flags);
done:
@@ -1988,7 +1988,7 @@ static enum hrtimer_restart dummy_timer(struct hrtimer *t)
if (ep)
ep->already_seen = ep->setup_stage = 0;
- usb_hcd_unlink_urb_from_ep(dummy_hcd_to_hcd(dum_hcd), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&dum->lock);
usb_hcd_giveback_urb(dummy_hcd_to_hcd(dum_hcd), urb, status);
spin_lock(&dum->lock);
@@ -271,7 +271,7 @@ ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
urb->actual_length, urb->transfer_buffer_length);
#endif
- usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
usb_hcd_giveback_urb(ehci_to_hcd(ehci), urb, status);
}
@@ -1133,7 +1133,7 @@ submit_async (
qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
if (unlikely(qh == NULL)) {
- usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
rc = -ENOMEM;
goto done;
}
@@ -957,7 +957,7 @@ static int intr_submit(
done:
if (unlikely(status))
- usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
done_not_linked:
spin_unlock_irqrestore(&ehci->lock, flags);
if (status)
@@ -1964,7 +1964,7 @@ static int itd_submit(struct ehci_hcd *ehci, struct urb *urb,
status = 0;
ehci_urb_done(ehci, urb, 0);
} else {
- usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
}
done_not_linked:
spin_unlock_irqrestore(&ehci->lock, flags);
@@ -2341,7 +2341,7 @@ static int sitd_submit(struct ehci_hcd *ehci, struct urb *urb,
status = 0;
ehci_urb_done(ehci, urb, 0);
} else {
- usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
}
done_not_linked:
spin_unlock_irqrestore(&ehci->lock, flags);
@@ -198,7 +198,7 @@ void fhci_urb_complete_free(struct fhci_hcd *fhci, struct urb *urb)
urb->status = 0;
}
- usb_hcd_unlink_urb_from_ep(fhci_to_hcd(fhci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&fhci->lock);
@@ -304,7 +304,7 @@ __releases(isp116x->lock) __acquires(isp116x->lock)
urb_dbg(urb, "Finish");
- usb_hcd_unlink_urb_from_ep(isp116x_to_hcd(isp116x), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&isp116x->lock);
usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb, status);
spin_lock(&isp116x->lock);
@@ -824,7 +824,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd,
fail:
if (ret)
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
fail_not_linked:
spin_unlock_irqrestore(&isp116x->lock, flags);
return ret;
@@ -466,7 +466,7 @@ static void finish_request(struct isp1362_hcd *isp1362_hcd, struct isp1362_ep *e
"short_ok" : "", urb->status);
- usb_hcd_unlink_urb_from_ep(isp1362_hcd_to_hcd(isp1362_hcd), urb);
+ usb_hcd_unlink_urb_from_ep(isp1362_hcd_to_hcd(urb));
spin_unlock(&isp1362_hcd->lock);
usb_hcd_giveback_urb(isp1362_hcd_to_hcd(isp1362_hcd), urb, status);
spin_lock(&isp1362_hcd->lock);
@@ -1384,7 +1384,7 @@ static int isp1362_urb_enqueue(struct usb_hcd *hcd,
}
fail:
if (retval)
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
fail_not_linked:
@@ -779,7 +779,7 @@ max3421_check_unlink(struct usb_hcd *hcd)
retval = 1;
dev_dbg(&spi->dev, "%s: URB %p unlinked=%d",
__func__, urb, urb->unlinked);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&max3421_hcd->lock,
flags);
usb_hcd_giveback_urb(hcd, urb, 0);
@@ -1352,7 +1352,7 @@ max3421_urb_done(struct usb_hcd *hcd)
max3421_hcd->curr_urb = NULL;
spin_lock_irqsave(&max3421_hcd->lock, flags);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&max3421_hcd->lock, flags);
/* must be called without the HCD spinlock: */
@@ -2036,7 +2036,7 @@ static void octeon_usb_urb_complete_callback(struct octeon_hcd *usb,
urb->status = -EPROTO;
break;
}
- usb_hcd_unlink_urb_from_ep(octeon_to_hcd(usb), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&usb->lock);
usb_hcd_giveback_urb(octeon_to_hcd(usb), urb, urb->status);
spin_lock(&usb->lock);
@@ -3161,7 +3161,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd,
>> 11) & 0x3,
split_device, split_port);
if (!pipe) {
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&usb->lock, flags);
dev_dbg(dev, "Failed to create pipe\n");
return -ENOMEM;
@@ -3231,7 +3231,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd,
break;
}
if (!transaction) {
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&usb->lock, flags);
dev_dbg(dev, "Failed to submit\n");
return -ENOMEM;
@@ -226,7 +226,7 @@ static int ohci_urb_enqueue (
if (ed->state == ED_IDLE) {
retval = ed_schedule (ohci, ed);
if (retval < 0) {
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
goto fail;
}
@@ -70,7 +70,7 @@ __acquires(ohci->lock)
}
/* urb->complete() can reenter this HCD */
- usb_hcd_unlink_urb_from_ep(ohci_to_hcd(ohci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock (&ohci->lock);
usb_hcd_giveback_urb(ohci_to_hcd(ohci), urb, status);
spin_lock (&ohci->lock);
@@ -823,7 +823,7 @@ __acquires(r8a66597->lock)
flush_dcache_page(virt_to_page(ptr));
}
- usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&r8a66597->lock);
usb_hcd_giveback_urb(r8a66597_to_hcd(r8a66597), urb, status);
spin_lock(&r8a66597->lock);
@@ -1943,7 +1943,7 @@ static int r8a66597_urb_enqueue(struct usb_hcd *hcd,
error:
if (ret)
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
error_not_linked:
spin_unlock_irqrestore(&r8a66597->lock, flags);
return ret;
@@ -429,7 +429,7 @@ static void finish_request(
if (usb_pipecontrol(urb->pipe))
ep->nextpid = USB_PID_SETUP;
- usb_hcd_unlink_urb_from_ep(sl811_to_hcd(sl811), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&sl811->lock);
usb_hcd_giveback_urb(sl811_to_hcd(sl811), urb, status);
spin_lock(&sl811->lock);
@@ -951,7 +951,7 @@ static int sl811h_urb_enqueue(
sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable);
fail:
if (retval)
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
fail_not_linked:
spin_unlock_irqrestore(&sl811->lock, flags);
return retval;
@@ -1472,7 +1472,7 @@ static int uhci_urb_enqueue(struct usb_hcd *hcd,
uhci_free_urb_priv(uhci, urbp);
done:
if (ret)
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
done_not_linked:
spin_unlock_irqrestore(&uhci->lock, flags);
return ret;
@@ -1550,7 +1550,7 @@ __acquires(uhci->lock)
}
uhci_free_urb_priv(uhci, urbp);
- usb_hcd_unlink_urb_from_ep(uhci_to_hcd(uhci), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&uhci->lock);
usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb, status);
@@ -775,7 +775,7 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci,
}
}
xhci_urb_free_priv(urb_priv);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
trace_xhci_urb_giveback(urb);
usb_hcd_giveback_urb(hcd, urb, status);
}
@@ -4178,7 +4178,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
ep_ring->enqueue = urb_priv->td[0].first_trb;
ep_ring->enq_seg = urb_priv->td[0].start_seg;
ep_ring->cycle_state = start_cycle;
- usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
return ret;
}
@@ -1789,7 +1789,7 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
err_giveback:
if (urb_priv)
xhci_urb_free_priv(urb_priv);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&xhci->lock, flags);
usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN);
return ret;
@@ -280,7 +280,7 @@ __acquires(musb->lock)
{
trace_musb_urb_gb(musb, urb);
- usb_hcd_unlink_urb_from_ep(musb->hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock(&musb->lock);
usb_hcd_giveback_urb(musb->hcd, urb, status);
spin_lock(&musb->lock);
@@ -2157,7 +2157,7 @@ static int musb_urb_enqueue(
qh = kzalloc(sizeof *qh, mem_flags);
if (!qh) {
spin_lock_irqsave(&musb->lock, flags);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&musb->lock, flags);
return -ENOMEM;
}
@@ -2292,7 +2292,7 @@ static int musb_urb_enqueue(
done:
if (ret != 0) {
spin_lock_irqsave(&musb->lock, flags);
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&musb->lock, flags);
kfree(qh);
}
@@ -652,7 +652,7 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
usbhsh_pipe_detach(hpriv, usbhsh_ep_to_uep(urb->ep));
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
usb_hcd_giveback_urb(hcd, urb, status);
}
@@ -806,7 +806,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
return 0;
no_need_xmit:
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
no_need_unlink:
spin_unlock_irqrestore(&vhci->lock, flags);
if (!ret) {
@@ -912,7 +912,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
* vhci_rx will receive RET_UNLINK and give back the URB.
* Otherwise, we give back it here.
*/
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&vhci->lock, flags);
usb_hcd_giveback_urb(hcd, urb, urb->status);
@@ -977,7 +977,7 @@ static void vhci_cleanup_unlink_list(struct vhci_device *vdev,
urb->status = -ENODEV;
- usb_hcd_unlink_urb_from_ep(hcd, urb);
+ usb_hcd_unlink_urb_from_ep(urb);
list_del(&unlink->list);
@@ -101,7 +101,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
usbip_dbg_vhci_rx("now giveback urb %u\n", pdu->base.seqnum);
spin_lock_irqsave(&vhci->lock, flags);
- usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci_hcd), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&vhci->lock, flags);
usb_hcd_giveback_urb(vhci_hcd_to_hcd(vhci_hcd), urb, urb->status);
@@ -172,7 +172,7 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev,
pr_info("urb->status %d\n", urb->status);
spin_lock_irqsave(&vhci->lock, flags);
- usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci_hcd), urb);
+ usb_hcd_unlink_urb_from_ep(urb);
spin_unlock_irqrestore(&vhci->lock, flags);
usb_hcd_giveback_urb(vhci_hcd_to_hcd(vhci_hcd), urb, urb->status);
@@ -425,7 +425,7 @@ static inline bool hcd_uses_dma(struct usb_hcd *hcd)
extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
int status);
-extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb);
+extern void usb_hcd_unlink_urb_from_ep(struct urb *urb);
extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags);
extern int usb_hcd_unlink_urb(struct urb *urb, int status);
The first parameter of the usb_hcd_unlink_urb_from_ep() is not used. This causes many callers to have to pass an additional parameter unnecessarily. Let's remove it Signed-off-by: 李哲 <sensor1010@163.com> --- drivers/usb/c67x00/c67x00-sched.c | 6 +++--- drivers/usb/core/hcd.c | 9 ++++----- drivers/usb/fotg210/fotg210-hcd.c | 10 +++++----- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- drivers/usb/host/ehci-q.c | 4 ++-- drivers/usb/host/ehci-sched.c | 6 +++--- drivers/usb/host/fhci-q.c | 2 +- drivers/usb/host/isp116x-hcd.c | 4 ++-- drivers/usb/host/isp1362-hcd.c | 4 ++-- drivers/usb/host/max3421-hcd.c | 4 ++-- drivers/usb/host/octeon-hcd.c | 6 +++--- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-q.c | 2 +- drivers/usb/host/r8a66597-hcd.c | 4 ++-- drivers/usb/host/sl811-hcd.c | 4 ++-- drivers/usb/host/uhci-q.c | 4 ++-- drivers/usb/host/xhci-ring.c | 4 ++-- drivers/usb/host/xhci.c | 2 +- drivers/usb/musb/musb_host.c | 6 +++--- drivers/usb/renesas_usbhs/mod_host.c | 2 +- drivers/usb/usbip/vhci_hcd.c | 6 +++--- drivers/usb/usbip/vhci_rx.c | 4 ++-- include/linux/usb/hcd.h | 2 +- 23 files changed, 49 insertions(+), 50 deletions(-)