summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-01-19 10:46:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 14:49:58 -0800
commit6a8e87b23ff4a979bde5451a242466a4b3f9fe7d (patch)
tree3b3da90cdf42c363fbd6270c58dd21811b8e3004 /drivers/usb/host
parent1393adb2ebb00a2cd54b293cd7ee71e3376f4e9f (diff)
[PATCH] USB core and HCDs: don't put_device while atomic
This patch (as640) removes several put_device and the corresponding get_device calls from the USB core and HCDs. Some of the puts were done in atomic contexts, and none of them are needed since the core now guarantees that every endpoint will be disabled and every URB completed before a USB device is released. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-mem.c1
-rw-r--r--drivers/usb/host/ehci-q.c2
-rw-r--r--drivers/usb/host/ehci-sched.c6
-rw-r--r--drivers/usb/host/isp116x-hcd.c3
-rw-r--r--drivers/usb/host/sl811-hcd.c3
-rw-r--r--drivers/usb/host/uhci-q.c2
6 files changed, 5 insertions, 12 deletions
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 91c2ab43cbc..ec7eb3f4f86 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -75,7 +75,6 @@ static void qh_destroy (struct kref *kref)
}
if (qh->dummy)
ehci_qtd_free (ehci, qh->dummy);
- usb_put_dev (qh->dev);
dma_pool_free (ehci->qh_pool, qh, qh->qh_dma);
}
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 5ada7cd5698..e469221e7ec 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -702,7 +702,7 @@ qh_make (
}
/* support for tt scheduling, and access to toggles */
- qh->dev = usb_get_dev (urb->dev);
+ qh->dev = urb->dev;
/* using TT? */
switch (urb->dev->speed) {
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 88419c6823a..90d6900a37f 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1399,7 +1399,7 @@ itd_complete (
*/
/* give urb back to the driver ... can be out-of-order */
- dev = usb_get_dev (urb->dev);
+ dev = urb->dev;
ehci_urb_done (ehci, urb, regs);
urb = NULL;
@@ -1418,7 +1418,6 @@ itd_complete (
(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
}
iso_stream_put (ehci, stream);
- usb_put_dev (dev);
return 1;
}
@@ -1765,7 +1764,7 @@ sitd_complete (
*/
/* give urb back to the driver */
- dev = usb_get_dev (urb->dev);
+ dev = urb->dev;
ehci_urb_done (ehci, urb, regs);
urb = NULL;
@@ -1784,7 +1783,6 @@ sitd_complete (
(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
}
iso_stream_put (ehci, stream);
- usb_put_dev (dev);
return 1;
}
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 972ce04889f..fea5dcbec7c 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -724,7 +724,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd,
ep = hep->hcpriv;
else {
INIT_LIST_HEAD(&ep->schedule);
- ep->udev = usb_get_dev(udev);
+ ep->udev = udev;
ep->epnum = epnum;
ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out);
usb_settoggle(udev, epnum, is_out, 0);
@@ -891,7 +891,6 @@ static void isp116x_endpoint_disable(struct usb_hcd *hcd,
if (!list_empty(&hep->urb_list))
WARN("ep %p not empty?\n", ep);
- usb_put_dev(ep->udev);
kfree(ep);
hep->hcpriv = NULL;
}
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 517360b77d8..a9234305275 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -853,7 +853,7 @@ static int sl811h_urb_enqueue(
} else {
INIT_LIST_HEAD(&ep->schedule);
- ep->udev = usb_get_dev(udev);
+ ep->udev = udev;
ep->epnum = epnum;
ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out);
ep->defctrl = SL11H_HCTLMASK_ARM | SL11H_HCTLMASK_ENABLE;
@@ -1052,7 +1052,6 @@ sl811h_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
if (!list_empty(&hep->urb_list))
WARN("ep %p not empty?\n", ep);
- usb_put_dev(ep->udev);
kfree(ep);
hep->hcpriv = NULL;
}
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index 5d2f9575ab4..a06d84c19e1 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -179,7 +179,6 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci,
qh->hep = hep;
qh->udev = udev;
hep->hcpriv = qh;
- usb_get_dev(udev);
} else { /* Skeleton QH */
qh->state = QH_STATE_ACTIVE;
@@ -197,7 +196,6 @@ static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
list_del(&qh->node);
if (qh->udev) {
qh->hep->hcpriv = NULL;
- usb_put_dev(qh->udev);
uhci_free_td(uhci, qh->dummy_td);
}
dma_pool_free(uhci->qh_pool, qh, qh->dma_handle);