aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-05-04 11:54:50 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:29:46 -0400
commit06b84e8adcad8280d76a7c71e772c5cddba96d85 (patch)
treef2d380412243099529ea94ebeccd2b39a775a6a9 /drivers/usb/core/hub.c
parentf3fd77cd2f4499f3e2ef9a1e6d5e4f4349d556c3 (diff)
USB: remove "locktree" routine from the hub driver
This patch (as892) removes the "locktree" routine from the hub driver. It currently is used in only one place, by a single kernel thread; hence it isn't doing any good. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 70202307531..9464eb504ae 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -982,49 +982,6 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
982} 982}
983 983
984 984
985/* grab device/port lock, returning index of that port (zero based).
986 * protects the upstream link used by this device from concurrent
987 * tree operations like suspend, resume, reset, and disconnect, which
988 * apply to everything downstream of a given port.
989 */
990static int locktree(struct usb_device *udev)
991{
992 int t;
993 struct usb_device *hdev;
994
995 if (!udev)
996 return -ENODEV;
997
998 /* root hub is always the first lock in the series */
999 hdev = udev->parent;
1000 if (!hdev) {
1001 usb_lock_device(udev);
1002 return 0;
1003 }
1004
1005 /* on the path from root to us, lock everything from
1006 * top down, dropping parent locks when not needed
1007 */
1008 t = locktree(hdev);
1009 if (t < 0)
1010 return t;
1011
1012 /* everything is fail-fast once disconnect
1013 * processing starts
1014 */
1015 if (udev->state == USB_STATE_NOTATTACHED) {
1016 usb_unlock_device(hdev);
1017 return -ENODEV;
1018 }
1019
1020 /* when everyone grabs locks top->bottom,
1021 * non-overlapping work may be concurrent
1022 */
1023 usb_lock_device(udev);
1024 usb_unlock_device(hdev);
1025 return udev->portnum;
1026}
1027
1028static void recursively_mark_NOTATTACHED(struct usb_device *udev) 985static void recursively_mark_NOTATTACHED(struct usb_device *udev)
1029{ 986{
1030 int i; 987 int i;
@@ -2594,10 +2551,7 @@ static void hub_events(void)
2594 2551
2595 /* Lock the device, then check to see if we were 2552 /* Lock the device, then check to see if we were
2596 * disconnected while waiting for the lock to succeed. */ 2553 * disconnected while waiting for the lock to succeed. */
2597 if (locktree(hdev) < 0) { 2554 usb_lock_device(hdev);
2598 usb_put_intf(intf);
2599 continue;
2600 }
2601 if (hub != usb_get_intfdata(intf)) 2555 if (hub != usb_get_intfdata(intf))
2602 goto loop; 2556 goto loop;
2603 2557