PCI/ERR: Simplify by computing pci_pcie_type() once
[linux-2.6-microblaze.git] / drivers / pci / pcie / portdrv_pci.c
index 3a3ce40..ff9517e 100644 (file)
@@ -101,12 +101,14 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {
 static int pcie_portdrv_probe(struct pci_dev *dev,
                                        const struct pci_device_id *id)
 {
+       int type = pci_pcie_type(dev);
        int status;
 
        if (!pci_is_pcie(dev) ||
-           ((pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) &&
-            (pci_pcie_type(dev) != PCI_EXP_TYPE_UPSTREAM) &&
-            (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM)))
+           ((type != PCI_EXP_TYPE_ROOT_PORT) &&
+            (type != PCI_EXP_TYPE_UPSTREAM) &&
+            (type != PCI_EXP_TYPE_DOWNSTREAM) &&
+            (type != PCI_EXP_TYPE_RC_EC)))
                return -ENODEV;
 
        status = pcie_port_device_register(dev);
@@ -195,6 +197,8 @@ static const struct pci_device_id port_pci_ids[] = {
        { PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0) },
        /* subtractive decode PCI-to-PCI bridge, class type is 060401h */
        { PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x01), ~0) },
+       /* handle any Root Complex Event Collector */
+       { PCI_DEVICE_CLASS(((PCI_CLASS_SYSTEM_RCEC << 8) | 0x00), ~0) },
        { },
 };