summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Hjelm <hjelmn@me.com>2013-05-14 19:25:55 -0600
committerHans de Goede <hdegoede@redhat.com>2013-05-16 10:55:59 +0200
commit8a76406d91d66eb63898ad6b94a0c0c8d27fb3e0 (patch)
treeb7b279f20e167dfcd0b1553761efe993f8e6cb6e
parent4b23b75cc464d463f21978ebab00b9cf392254fd (diff)
downloadlibusb-8a76406d91d66eb63898ad6b94a0c0c8d27fb3e0.tar.gz
darwin: fix topology
The parent device should always already be in the context when a device is processed. Use the parent device's location to find the parent dev. Note: we might want to replicate the notion of a locationID in the core. If done right the parent dev could be determined in the core. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--libusb/os/darwin_usb.c15
-rw-r--r--libusb/version_nano.h2
2 files changed, 2 insertions, 15 deletions
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index f03593d..07d8c5a 100644
--- a/libusb/os/darwin_usb.c
+++ b/libusb/os/darwin_usb.c
@@ -767,21 +767,8 @@ static int process_new_device (struct libusb_context *ctx, usb_device_t **device
if (ret < 0)
break;
- /* the device iterator provides devices in increasing order of location. given this property
- * we can use the last device to find the parent. */
-/* TODO: FIX TOPOLOGY!
- for (parent = *last_dev ; parent ; parent = parent->parent_dev) {
- struct darwin_device_priv *parent_priv = (struct darwin_device_priv *) parent->os_priv;
-
- if (parent_priv->location == parent_location) {
- break;
- }
- }
-
- dev->parent_dev = parent;
-
+ dev->parent_dev = usbi_get_device_by_session_id (ctx, parent_location);
dev->port_number = port;
-*/
dev->bus_number = locationID >> 24;
dev->device_address = address;
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index dbc62bf..3430774 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10671
+#define LIBUSB_NANO 10672