From 8f1d4c65924a2d85f41950c53088920fceb05aa1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 1 Dec 2009 10:03:49 +0000 Subject: (pci_probe) simplify reusing pci_find_cap() --- pci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pci.c b/pci.c index 57b7dbe..244bd3b 100644 --- a/pci.c +++ b/pci.c @@ -36,7 +36,6 @@ extern struct pciusb_entries pci_probe(void) { static struct pci_access *pacc; struct pci_dev *dev; char classbuf[128], vendorbuf[128], devbuf[128]; - struct pci_cap *cap; pacc = pci_alloc(); @@ -87,13 +86,8 @@ extern struct pciusb_entries pci_probe(void) { e->subdevice = 0xffff; } - for (cap = dev->first_cap; cap; cap = cap->next) { - switch (cap->id) { - case PCI_CAP_ID_EXP: + if (pci_find_cap(dev,PCI_CAP_ID_EXP, PCI_CAP_NORMAL)) e->is_pciexpress = 1; - break; - } - } /* special case for realtek 8139 that has two drivers */ if (e->vendor == 0x10ec && e->device == 0x8139) { -- cgit v1.2.1