diff options
author | Burt P <pburt0@gmail.com> | 2019-12-27 22:12:49 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-12-27 22:16:36 -0800 |
commit | 79d8b3c8b4f54e17b35cf82fc97af9d8be73d7dc (patch) | |
tree | c3f08fcb3f1174fb5315b1b821d247602ed40906 /hardinfo | |
parent | 9b8122e2c3378966641568f9c12ce10a6a9ec45c (diff) |
usb: vendor tags in list
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo')
-rw-r--r-- | hardinfo/usb_util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hardinfo/usb_util.c b/hardinfo/usb_util.c index f883657c..8b73332f 100644 --- a/hardinfo/usb_util.c +++ b/hardinfo/usb_util.c @@ -58,6 +58,7 @@ usbd *usbd_new() { void usbd_free(usbd *s) { if (s) { usbi_list_free(s->if_list); + vendor_list_free(s->vendors); g_free(s->vendor); g_free(s->product); g_free(s->manufacturer); @@ -517,11 +518,17 @@ static usbd *usb_get_device_list_sysfs() { } usbd *usb_get_device_list() { - usbd *lst; + usbd *lst, *l; lst = usb_get_device_list_sysfs(); if (lst == NULL) lst = usb_get_device_list_lsusb(); + l = lst; + while(l) { + l->vendors = vendor_list_remove_duplicates_deep(vendors_match(l->vendor, l->manufacturer, NULL)); + l = l->next; + } + return lst; } |