diff mbox

Prevent AER driver from being loaded on PCIE devices which are not root ports.

Message ID 20090921101824.10742.75148.stgit@localhost.localdomain
State Accepted, archived
Headers show

Commit Message

Malcolm Crossley Sept. 21, 2009, 10:27 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 52f84fc..2f0cfd5 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -225,7 +225,9 @@  static int get_port_device_capability(struct pci_dev *dev)
 	int services = 0, pos;
 	u16 reg16;
 	u32 reg32;
+	struct pcie_port_data *port_data;
 
+	port_data = pci_get_drvdata(dev);
 	pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
 	pci_read_config_word(dev, pos + PCIE_CAPABILITIES_REG, &reg16);
 	/* Hot-Plug Capable */
@@ -236,7 +238,8 @@  static int get_port_device_capability(struct pci_dev *dev)
 			services |= PCIE_PORT_SERVICE_HP;
 	}
 	/* AER capable */
-	if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR))
+	if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR) &&
+		port_data->port_type == PCIE_RC_PORT)
 		services |= PCIE_PORT_SERVICE_AER;
 	/* VC support */
 	if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VC))