X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fsysfs.c;h=2c0a46f7763aa2764660873da73ca040e8f3fe12;hb=087e22e7bfdfc3eb0664ac9cca571c3858d838c9;hp=0cdfe9ab9b75d50b53d2b3043420dd4633bb6a59;hpb=098174370094ba8c31f86bd9faed3796dcaeb1db;p=pciutils.git diff --git a/lib/sysfs.c b/lib/sysfs.c index 0cdfe9a..2c0a46f 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -25,7 +25,7 @@ static void sysfs_config(struct pci_access *a) { - a->method_params[PCI_ACCESS_SYS_BUS_PCI] = PATH_SYS_BUS_PCI; + a->method_params[PCI_ACCESS_SYS_BUS_PCI] = PCI_PATH_SYS_BUS_PCI; } static inline char * @@ -105,7 +105,7 @@ sysfs_get_resources(struct pci_dev *d) file = fopen(namebuf, "r"); if (!file) a->error("Cannot open %s: %s", namebuf, strerror(errno)); - for (i = 0; i < 8; i++) + for (i = 0; i < 7; i++) { unsigned long long start, end, size; if (!fgets(buf, sizeof(buf), file)) @@ -115,14 +115,14 @@ sysfs_get_resources(struct pci_dev *d) if (start != (unsigned long long)(pciaddr_t) start || end != (unsigned long long)(pciaddr_t) end) { - a->warning("Resource %d in %s has a 64-bit address, ignoring", namebuf); + a->warning("Resource %d in %s has a 64-bit address, ignoring", i, namebuf); start = end = 0; } if (start) size = end - start + 1; else size = 0; - if (i < 7) + if (i < 6) { d->base_addr[i] = start; d->size[i] = size;