diff options
-rw-r--r-- | hw/xfree86/os-support/bus/Pci.c | 5 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/linuxPci.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index ffa906505..4bc189bbd 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -954,10 +954,13 @@ xf86scanpci(int flags) pciBusInfo_t *busp; int idx = 0, i; PCITAG tag; + static Bool done = FALSE; - if (pci_devp[0]) + if (done || pci_devp[0]) return pci_devp; + done = TRUE; + pciInit(); #ifdef XF86SCANPCI_WRAPPER diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index 6e33c2550..146dccfd3 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -113,14 +113,16 @@ linuxPciOpenFile(PCITAG tag) if (fd != -1) close(fd); if (bus < 256) { - if (stat("/proc/bus/pci/00", &ignored) < 0) + sprintf(file,"/proc/bus/pci/%02x",bus); + if (stat(file, &ignored) < 0) sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x", bus, dev, func); else sprintf(file, "/proc/bus/pci/%02x/%02x.%1x", bus, dev, func); } else { - if (stat("/proc/bus/pci/00", &ignored) < 0) + sprintf(file,"/proc/bus/pci/%04x",bus); + if (stat(file, &ignored) < 0) sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x", bus, dev, func); else |