From 534fbba975ad68865ebcafa1636233ce43335c9e Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Mon, 29 Jun 2009 05:07:41 -0600 Subject: [PATCH] sysfs: Avoid warnings when the slot address is missing. --- lib/sysfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 2419b41..4c2c846 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -221,11 +221,13 @@ sysfs_fill_slots(struct pci_access *a) if (n < 0 || n >= OBJNAMELEN) a->error("File name too long"); file = fopen(namebuf, "r"); + /* + * Old versions of Linux had a fakephp which didn't have an 'address' + * file. There's no useful information to be gleaned from these + * devices, pretend they're not there. + */ if (!file) - { - a->warning("sysfs_fill_slots: Cannot open %s: %s", namebuf, strerror(errno)); - continue; - } + continue; if (!fgets(buf, sizeof(buf), file) || sscanf(buf, "%x:%x:%x", &dom, &bus, &dev) < 3) a->warning("sysfs_fill_slots: Couldn't parse entry address %s", buf); -- 2.39.5