diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-04-03 06:05:47 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-04-03 06:05:47 +0000 |
commit | 0b5b4bfec7382c2dcc3c74a9116f10faa68b40a1 (patch) | |
tree | e446888d0b163730cc00c2c78e83ff0bb87da481 | |
parent | 9d1712c824f25adab5029e6731479420c80d53c8 (diff) | |
download | ldetect-0b5b4bfec7382c2dcc3c74a9116f10faa68b40a1.tar ldetect-0b5b4bfec7382c2dcc3c74a9116f10faa68b40a1.tar.gz ldetect-0b5b4bfec7382c2dcc3c74a9116f10faa68b40a1.tar.bz2 ldetect-0b5b4bfec7382c2dcc3c74a9116f10faa68b40a1.tar.xz ldetect-0b5b4bfec7382c2dcc3c74a9116f10faa68b40a1.zip |
correctly use usbdev busnum and devnum when finding USB device in sysfs to get its modalias (#38721)
-rw-r--r-- | pciusb.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -112,8 +112,9 @@ static void find_usb_modules_through_aliases(struct pciusb_entry *e) { DIR *dir; struct dirent *dent; - asprintf(&device_prefix, "%x-%x", e->pci_bus, e->pci_device); - asprintf(&sysfs_path, "/sys/bus/usb/devices/%s", device_prefix); + asprintf(&device_prefix, "%d-", e->pci_bus); + /* usbdev<busnum>.<devnum> */ + asprintf(&sysfs_path, "/sys/class/usb_device/usbdev%d.%d/device", e->pci_bus, e->pci_device); dir = opendir(sysfs_path); if (!dir) |