From 79d8b3c8b4f54e17b35cf82fc97af9d8be73d7dc Mon Sep 17 00:00:00 2001 From: Burt P Date: Fri, 27 Dec 2019 22:12:49 -0600 Subject: usb: vendor tags in list Signed-off-by: Burt P --- hardinfo/usb_util.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'hardinfo/usb_util.c') 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; } -- cgit v1.2.3