aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/pme.c
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2012-07-24 05:20:03 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-08-23 11:40:57 -0400
commit62f87c0e31d646d5501edf4f7feb07d0ad689d80 (patch)
treef2aa208c10f6cf8b91634f91efda44efc6f4c25f /drivers/pci/pcie/pme.c
parent786e22885d9959fda0473ace5a61cb11620fba9b (diff)
PCI: Introduce pci_pcie_type(dev) to replace pci_dev->pcie_type
Introduce an inline function pci_pcie_type(dev) to extract PCIe device type from pci_dev->pcie_flags_reg field, and prepare for removing pci_dev->pcie_type. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pcie/pme.c')
-rw-r--r--drivers/pci/pcie/pme.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 001f1b78f39c..30897bf05b58 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -120,7 +120,7 @@ static bool pcie_pme_from_pci_bridge(struct pci_bus *bus, u8 devfn)
120 if (!dev) 120 if (!dev)
121 return false; 121 return false;
122 122
123 if (pci_is_pcie(dev) && dev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) { 123 if (pci_is_pcie(dev) && pci_pcie_type(dev) == PCI_EXP_TYPE_PCI_BRIDGE) {
124 down_read(&pci_bus_sem); 124 down_read(&pci_bus_sem);
125 if (pcie_pme_walk_bus(bus)) 125 if (pcie_pme_walk_bus(bus))
126 found = true; 126 found = true;
@@ -335,13 +335,13 @@ static void pcie_pme_mark_devices(struct pci_dev *port)
335 struct pci_dev *dev; 335 struct pci_dev *dev;
336 336
337 /* Check if this is a root port event collector. */ 337 /* Check if this is a root port event collector. */
338 if (port->pcie_type != PCI_EXP_TYPE_RC_EC || !bus) 338 if (pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC || !bus)
339 return; 339 return;
340 340
341 down_read(&pci_bus_sem); 341 down_read(&pci_bus_sem);
342 list_for_each_entry(dev, &bus->devices, bus_list) 342 list_for_each_entry(dev, &bus->devices, bus_list)
343 if (pci_is_pcie(dev) 343 if (pci_is_pcie(dev)
344 && dev->pcie_type == PCI_EXP_TYPE_RC_END) 344 && pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
345 pcie_pme_set_native(dev, NULL); 345 pcie_pme_set_native(dev, NULL);
346 up_read(&pci_bus_sem); 346 up_read(&pci_bus_sem);
347 } 347 }