]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PCI Hotplug: pciehp: use generic function to find ext capability
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Fri, 9 Nov 2007 08:28:11 +0000 (17:28 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Feb 2008 23:04:24 +0000 (15:04 -0800)
Remove duplicated code to find an extend capability in PCIEHP driver.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/pciehp_pci.c

index c424aded13fb43fb108d41870d1c4f46c207de28..c09b0c2f8065b2bf63563c7a2badf8662703834d 100644 (file)
@@ -105,12 +105,7 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
        }
 
        /* Find Advanced Error Reporting Enhanced Capability */
-       pos = 256;
-       do {
-               pci_read_config_dword(dev, pos, &reg32);
-               if (PCI_EXT_CAP_ID(reg32) == PCI_EXT_CAP_ID_ERR)
-                       break;
-       } while ((pos = PCI_EXT_CAP_NEXT(reg32)));
+       pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
        if (!pos)
                return;