aboutsummaryrefslogtreecommitdiff
path: root/modules/devices/pci.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-12-31 23:15:28 -0600
committerLeandro A. F. Pereira <leandro@hardinfo.org>2020-01-03 09:33:24 -0800
commit2d2290b346927851044ffcf5bbb63a0a0040d5a5 (patch)
tree5412c87e21c2de78ce643e6b0b800034c92b8c7d /modules/devices/pci.c
parent1afd683fea89d759ea05a65194e05e4eed38847c (diff)
pci_util: read class strings from pci.ids, use class for unknown product
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices/pci.c')
-rw-r--r--modules/devices/pci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/devices/pci.c b/modules/devices/pci.c
index 6cd0b606..aff51e2b 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;
- gchar *class, *vendor, *svendor, *product, *sproduct;
+ const gchar *class, *vendor, *svendor, *product, *sproduct;
gchar *name, *key;
gboolean device_is_sdevice = (p->vendor_id == p->sub_vendor_id && p->device_id == p->sub_device_id);
@@ -69,7 +69,8 @@ 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 = UNKIFNULL_AC(p->device_id_str);
+ product = p->device_id_str ? p->device_id_str : p->class_str;
+ product = UNKIFNULL_AC(product);
sproduct = UNKIFNULL_AC(p->sub_device_id_str);
gchar *ven_tag = vendor_match_tag(p->vendor_id_str, params.fmt_opts);