From 26033824194fbabd51547119e45e80cf40b433b6 Mon Sep 17 00:00:00 2001 From: Burt P Date: Tue, 31 Dec 2019 23:18:54 -0600 Subject: pci: on second thought, only use class for missing device in list The details will still show the specific device is unknown. Signed-off-by: Burt P --- modules/devices/pci.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'modules/devices') diff --git a/modules/devices/pci.c b/modules/devices/pci.c index aff51e2b..14f51a94 100644 --- a/modules/devices/pci.c +++ b/modules/devices/pci.c @@ -61,7 +61,7 @@ static const gchar *find_icon_for_class(uint32_t class) static gchar *_pci_dev(const pcid *p, gchar *icons) { gchar *str; - const gchar *class, *vendor, *svendor, *product, *sproduct; + const gchar *class, *vendor, *svendor, *product, *sproduct, *lproduct; gchar *name, *key; gboolean device_is_sdevice = (p->vendor_id == p->sub_vendor_id && p->device_id == p->sub_device_id); @@ -69,20 +69,21 @@ static gchar *_pci_dev(const pcid *p, gchar *icons) { class = UNKIFNULL_AC(p->class_str); vendor = UNKIFNULL_AC(p->vendor_id_str); svendor = UNKIFNULL_AC(p->sub_vendor_id_str); - product = p->device_id_str ? p->device_id_str : p->class_str; - product = UNKIFNULL_AC(product); + product = UNKIFNULL_AC(p->device_id_str); sproduct = UNKIFNULL_AC(p->sub_device_id_str); + lproduct = p->device_id_str ? p->device_id_str : p->class_str; + lproduct = UNKIFNULL_AC(lproduct); gchar *ven_tag = vendor_match_tag(p->vendor_id_str, params.fmt_opts); gchar *sven_tag = vendor_match_tag(p->sub_vendor_id_str, params.fmt_opts); if (ven_tag) { if (sven_tag && p->vendor_id != p->sub_vendor_id) { - name = g_strdup_printf("%s %s %s", sven_tag, ven_tag, product); + name = g_strdup_printf("%s %s %s", sven_tag, ven_tag, lproduct); } else { - name = g_strdup_printf("%s %s", ven_tag, product); + name = g_strdup_printf("%s %s", ven_tag, lproduct); } } else { - name = g_strdup_printf("%s %s", vendor, product); + name = g_strdup_printf("%s %s", vendor, lproduct); } g_free(ven_tag); g_free(sven_tag); -- cgit v1.2.3