linux: Deal with devices being enumerated before their parents are
The linux netlink enumeration code processes devices in readdir order, which
means devices may get enumerated before their parent is, IE on my system
readdir order is (ls -U)
1-1 usb4 2-1.8 6-0:1.0 1-1.4.3 1-1.4.4.1:1.0
2-1 usb5 6-1.4 6-1:1.0 1-1.4.4 1-1.4.4.1:1.1
6-1 usb6 3-0:1.0 2-1.8:1.0 1-0:1.0 1-1.4.4.1:1.2
7-1 usb7 1-1.4.3:1.0 2-1.8:1.1 1-1:1.0
usb1 1-1.4.4.1 1-1.4.4:1.0 2-1.8:1.2 6-1.4:1.0
usb2 1-1.4:1.0 4-0:1.0 7-0:1.0 2-0:1.0
usb3 1-1.4 5-0:1.0 7-1:1.0 2-1:1.0
So 1.4.4.1 will get added (way) before 1.4.4 and indeed:
[ 0.002243] [
00004055] libusbx: debug [linux_get_device_address] scan 1-1.4.4.1
Dev 0x1973bc0 (1-1.4.4.1) has parent (nil)
This patch fixes this by forcing enumeration of the parent from
linux_parent_dev.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>