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>
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;
-#define LIBUSB_NANO 10671
+#define LIBUSB_NANO 10672