From 9592e1fcab84dd9b5ab3af6c2e2623269ba47ecf Mon Sep 17 00:00:00 2001 From: Ondrej Čerman Date: Sun, 4 Aug 2019 21:14:15 +0200 Subject: usb: use sysfs by default (that is usually faster than lsusb) --- hardinfo/usb_util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hardinfo/usb_util.c b/hardinfo/usb_util.c index 792750a6..c908eec4 100644 --- a/hardinfo/usb_util.c +++ b/hardinfo/usb_util.c @@ -427,10 +427,12 @@ usbd *usb_get_device(int bus, int dev, const gchar* sysfspath) { usbd *s = usbd_new(); int ok = 0; if (s) { - /* try lsusb */ - ok = usb_get_device_lsusb(bus, dev, s); /* try sysfs */ - ok |= usb_get_device_sysfs(bus, dev, sysfspath, s); + ok = usb_get_device_sysfs(bus, dev, sysfspath, s); + if (!ok) { + /* try lsusb */ + ok = usb_get_device_lsusb(bus, dev, s); + } if (!ok) { usbd_free(s); s = NULL; -- cgit v1.2.3