aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/devices.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-01-25 14:30:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-03 16:26:30 -0500
commit5363de75307e333d89df7531f9dd8310d973ecdb (patch)
tree5c90ec1dbcf6d1626984ec6306db7d73ee8dd3ab /drivers/usb/core/devices.c
parentd78540419866887345cec480016b0f87f6a5aca2 (diff)
usb: core: switch bus numbering to using idr
USB bus numbering is based on directly dealing with bitmaps and defines a separate list of busses. This can be simplified and unified by using existing idr functionality. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/devices.c')
-rw-r--r--drivers/usb/core/devices.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index b35a6a52210f..6118a04f0b84 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -110,13 +110,6 @@ static const char format_endpt[] =
110/* E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */ 110/* E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */
111 "E: Ad=%02x(%c) Atr=%02x(%-4s) MxPS=%4d Ivl=%d%cs\n"; 111 "E: Ad=%02x(%c) Atr=%02x(%-4s) MxPS=%4d Ivl=%d%cs\n";
112 112
113
114/*
115 * Need access to the driver and USB bus lists.
116 * extern struct list_head usb_bus_list;
117 * However, these will come from functions that return ptrs to each of them.
118 */
119
120/* 113/*
121 * Wait for an connect/disconnect event to happen. We initialize 114 * Wait for an connect/disconnect event to happen. We initialize
122 * the event counter with an odd number, and each event will increment 115 * the event counter with an odd number, and each event will increment
@@ -618,6 +611,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
618 struct usb_bus *bus; 611 struct usb_bus *bus;
619 ssize_t ret, total_written = 0; 612 ssize_t ret, total_written = 0;
620 loff_t skip_bytes = *ppos; 613 loff_t skip_bytes = *ppos;
614 int id;
621 615
622 if (*ppos < 0) 616 if (*ppos < 0)
623 return -EINVAL; 617 return -EINVAL;
@@ -628,7 +622,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
628 622
629 mutex_lock(&usb_bus_list_lock); 623 mutex_lock(&usb_bus_list_lock);
630 /* print devices for all busses */ 624 /* print devices for all busses */
631 list_for_each_entry(bus, &usb_bus_list, bus_list) { 625 idr_for_each_entry(&usb_bus_idr, bus, id) {
632 /* recurse through all children of the root hub */ 626 /* recurse through all children of the root hub */
633 if (!bus_to_hcd(bus)->rh_registered) 627 if (!bus_to_hcd(bus)->rh_registered)
634 continue; 628 continue;