diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 8947a4f06..5b236af78 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -257,7 +257,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) } #endif - xf86PciMatchDriver(matches, nmatches); + i = xf86PciMatchDriver(matches, nmatches); /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 085be0143..184f2213e 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1294,7 +1294,11 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip } #endif /* __linux__ */ -void +/** + * @return The numbers of found devices that match with the current system + * drivers. + */ +int xf86PciMatchDriver(char* matches[], int nmatches) { int i; struct pci_device * info = NULL; @@ -1326,4 +1330,6 @@ xf86PciMatchDriver(char* matches[], int nmatches) { if ((info != NULL) && (i < nmatches)) { i += videoPtrToDriverList(info, &(matches[i]), nmatches - i); } + + return i; } diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h index f84a496df..3f02b9330 100644 --- a/hw/xfree86/common/xf86pciBus.h +++ b/hw/xfree86/common/xf86pciBus.h @@ -37,6 +37,6 @@ void xf86PciProbe(void); Bool xf86PciAddMatchingDev(DriverPtr drvp); Bool xf86PciProbeDev(DriverPtr drvp); void xf86PciIsolateDevice(char *argument); -void xf86PciMatchDriver(char* matches[], int nmatches); +int xf86PciMatchDriver(char* matches[], int nmatches); #endif /* _XF86_PCI_BUS_H */