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 in0816e8fca6
("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:0816e8fca6
("linux: Make platform device probe less fragile") Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
This commit is contained in:
parent
af4622d3f9
commit
c0dcadad6c
|
@ -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");
|
value = udev_device_get_property_value(udev_device, "ID_PATH");
|
||||||
if (value && (str = strrstr(value, "pci-"))) {
|
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] = ':';
|
attribs->busid[3] = ':';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user