summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorReza Arbab <arbab@linux.ibm.com>2019-03-27 11:45:02 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2020-11-25 04:39:14 +0000
commitc0dcadad6c18b06ddc6e349d7c58bfccb715ff55 (patch)
treefd2b621aa1bd5eb4c615dd20758160bfd04bef87 /config
parentaf4622d3f90382225afb83e3896cb6f236f30c0a (diff)
linux: Fix udev ID_PATH parsing for udl devices
The ID_PATH for a udl device looks like this: $ udevadm info /dev/dri/card2 | grep -w ID_PATH E: ID_PATH=pci-0000:00:14.0-usb-0:9.1:1.0 The parsing added in 0816e8fca6194 ("linux: Make platform device probe less fragile"), sets OdevAttributes::busid to "pci:0000:00:14.0", where drmGetBusid() would have returned "3-9.1:1.0". Identifying this as a "pci:*" device eventually causes the vendor/device id check in probeSingleDevice() to fail, because a USB controller isn't a supported device: $ udevadm info --path=/devices/pci0000:00/0000:00:14.0 | grep -e VENDOR -e ID_PCI_CLASS E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller E: ID_VENDOR_FROM_DATABASE=Intel Corporation Instead of parsing out "pci:0000:00:14.0" in this case, use "usb:0:9.1:1.0" so the device probe will succeed. Fixes: 0816e8fca6194 ("linux: Make platform device probe less fragile") Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'config')
-rw-r--r--config/udev.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/config/udev.c b/config/udev.c
index c51bda98a..411a459f4 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -517,7 +517,12 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path
value = udev_device_get_property_value(udev_device, "ID_PATH");
if (value && (str = strrstr(value, "pci-"))) {
- attribs->busid = XNFstrdup(str);
+ value = str;
+
+ if ((str = strstr(value, "usb-")))
+ value = str;
+
+ attribs->busid = XNFstrdup(value);
attribs->busid[3] = ':';
}