summaryrefslogtreecommitdiffstats
path: root/usb.c
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-09-03 16:48:53 +0000
committerThierry Vignaud <tv@mandriva.org>2009-09-03 16:48:53 +0000
commit0b31cfc8bc149efac2983e7016b8b1720b174926 (patch)
treedb0fef3ebb8498c75988ba8c8a2fc15096634719 /usb.c
parentfbeef6b84834d762c9c665941f062b3c540e0365 (diff)
downloadldetect-0b31cfc8bc149efac2983e7016b8b1720b174926.tar
ldetect-0b31cfc8bc149efac2983e7016b8b1720b174926.tar.gz
ldetect-0b31cfc8bc149efac2983e7016b8b1720b174926.tar.bz2
ldetect-0b31cfc8bc149efac2983e7016b8b1720b174926.tar.xz
ldetect-0b31cfc8bc149efac2983e7016b8b1720b174926.zip
(usb_probe) do not display any warning when driver field is empty in
/proc/bus/usb/devices (#53412)
Diffstat (limited to 'usb.c')
-rw-r--r--usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usb.c b/usb.c
index e5d70b9..c7f6503 100644
--- a/usb.c
+++ b/usb.c
@@ -92,7 +92,7 @@ extern struct pciusb_entries usb_probe(void) {
case 'I': if (e->class_id == 0 || e->module == NULL) {
char driver[50];
int class_id, sub, prot = 0;
- if (sscanf(buf, "I:* If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) == 4) {
+ if (sscanf(buf, "I:* If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) >= 3) {
unsigned long cid = (class_id * 0x100 + sub) * 0x100 + prot;
if (e->class_id == 0)
e->class_id = cid;
@@ -112,7 +112,7 @@ extern struct pciusb_entries usb_probe(void) {
if (e->class_id == (0x1*0x100+ 0x01)) /* USB_AUDIO_CLASS*0x100 + USB_SUBCLASS_AUDIO_CONTROL*/
e->module = strdup("snd_usb_audio");
- } else if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) == 4) {
+ } else if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) >= 3) {
/* Ignore interfaces not active */
} else fprintf(stderr, "%s %d: unknown ``I'' line\n", proc_usb_path, line);
break;