summaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-01-25 20:30:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-03 13:26:30 -0800
commit5363de75307e333d89df7531f9dd8310d973ecdb (patch)
tree5c90ec1dbcf6d1626984ec6306db7d73ee8dd3ab /drivers/usb/mon
parentd78540419866887345cec480016b0f87f6a5aca2 (diff)
downloadlinux-5363de75307e333d89df7531f9dd8310d973ecdb.tar.gz
linux-5363de75307e333d89df7531f9dd8310d973ecdb.tar.bz2
linux-5363de75307e333d89df7531f9dd8310d973ecdb.zip
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/mon')
-rw-r--r--drivers/usb/mon/mon_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c
index fec3f1128fdc..9b87efb0e50d 100644
--- a/drivers/usb/mon/mon_main.c
+++ b/drivers/usb/mon/mon_main.c
@@ -349,7 +349,7 @@ struct mon_bus *mon_bus_lookup(unsigned int num)
static int __init mon_init(void)
{
struct usb_bus *ubus;
- int rc;
+ int rc, id;
if ((rc = mon_text_init()) != 0)
goto err_text;
@@ -366,9 +366,8 @@ static int __init mon_init(void)
// MOD_INC_USE_COUNT(which_module?);
mutex_lock(&usb_bus_list_lock);
- list_for_each_entry (ubus, &usb_bus_list, bus_list) {
+ idr_for_each_entry(&usb_bus_idr, ubus, id)
mon_bus_init(ubus);
- }
usb_register_notify(&mon_nb);
mutex_unlock(&usb_bus_list_lock);
return 0;