Commit b6956ffa authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

usbcore: store each usb_device's level in the tree

This patch (as778) adds a field to struct usb_device to store the
device's level in the USB tree.  In itself this number isn't really
important.  But the overhead is very low, and in a later patch it will
be used for preventing bogus warnings from the lockdep checker.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d1ad4ea3
...@@ -2414,6 +2414,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, ...@@ -2414,6 +2414,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
usb_set_device_state(udev, USB_STATE_POWERED); usb_set_device_state(udev, USB_STATE_POWERED);
udev->speed = USB_SPEED_UNKNOWN; udev->speed = USB_SPEED_UNKNOWN;
udev->bus_mA = hub->mA_per_port; udev->bus_mA = hub->mA_per_port;
udev->level = hdev->level + 1;
/* set the address */ /* set the address */
choose_address(udev); choose_address(udev);
......
...@@ -348,6 +348,7 @@ struct usb_device { ...@@ -348,6 +348,7 @@ struct usb_device {
unsigned short bus_mA; /* Current available from the bus */ unsigned short bus_mA; /* Current available from the bus */
u8 portnum; /* Parent port number (origin 1) */ u8 portnum; /* Parent port number (origin 1) */
u8 level; /* Number of USB hub ancestors */
int have_langid; /* whether string_langid is valid */ int have_langid; /* whether string_langid is valid */
int string_langid; /* language ID for strings */ int string_langid; /* language ID for strings */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment