提交 5f4d91a1 编写于 作者: K Kenji Kaneshige 提交者: Jesse Barnes

PCI: use pci_is_pcie() in pci core

Change for PCI core to use pci_is_pcie() instead of checking
pci_dev->is_pcie.
Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 7eb776c4
...@@ -329,7 +329,7 @@ int dmar_find_matched_atsr_unit(struct pci_dev *dev) ...@@ -329,7 +329,7 @@ int dmar_find_matched_atsr_unit(struct pci_dev *dev)
for (bus = dev->bus; bus; bus = bus->parent) { for (bus = dev->bus; bus; bus = bus->parent) {
struct pci_dev *bridge = bus->self; struct pci_dev *bridge = bus->self;
if (!bridge || !bridge->is_pcie || if (!bridge || !pci_is_pcie(bridge) ||
bridge->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) bridge->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE)
return 0; return 0;
......
...@@ -1611,7 +1611,7 @@ domain_context_mapping(struct dmar_domain *domain, struct pci_dev *pdev, ...@@ -1611,7 +1611,7 @@ domain_context_mapping(struct dmar_domain *domain, struct pci_dev *pdev,
return ret; return ret;
parent = parent->bus->self; parent = parent->bus->self;
} }
if (tmp->is_pcie) /* this is a PCIE-to-PCI bridge */ if (pci_is_pcie(tmp)) /* this is a PCIE-to-PCI bridge */
return domain_context_mapping_one(domain, return domain_context_mapping_one(domain,
pci_domain_nr(tmp->subordinate), pci_domain_nr(tmp->subordinate),
tmp->subordinate->number, 0, tmp->subordinate->number, 0,
...@@ -1651,7 +1651,7 @@ static int domain_context_mapped(struct pci_dev *pdev) ...@@ -1651,7 +1651,7 @@ static int domain_context_mapped(struct pci_dev *pdev)
return ret; return ret;
parent = parent->bus->self; parent = parent->bus->self;
} }
if (tmp->is_pcie) if (pci_is_pcie(tmp))
return device_context_mapped(iommu, tmp->subordinate->number, return device_context_mapped(iommu, tmp->subordinate->number,
0); 0);
else else
...@@ -1821,7 +1821,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw) ...@@ -1821,7 +1821,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw)
dev_tmp = pci_find_upstream_pcie_bridge(pdev); dev_tmp = pci_find_upstream_pcie_bridge(pdev);
if (dev_tmp) { if (dev_tmp) {
if (dev_tmp->is_pcie) { if (pci_is_pcie(dev_tmp)) {
bus = dev_tmp->subordinate->number; bus = dev_tmp->subordinate->number;
devfn = 0; devfn = 0;
} else { } else {
...@@ -2182,7 +2182,7 @@ static int iommu_should_identity_map(struct pci_dev *pdev, int startup) ...@@ -2182,7 +2182,7 @@ static int iommu_should_identity_map(struct pci_dev *pdev, int startup)
* the 1:1 domain, just in _case_ one of their siblings turns out * the 1:1 domain, just in _case_ one of their siblings turns out
* not to be able to map all of memory. * not to be able to map all of memory.
*/ */
if (!pdev->is_pcie) { if (!pci_is_pcie(pdev)) {
if (!pci_is_root_bus(pdev->bus)) if (!pci_is_root_bus(pdev->bus))
return 0; return 0;
if (pdev->class >> 8 == PCI_CLASS_BRIDGE_PCI) if (pdev->class >> 8 == PCI_CLASS_BRIDGE_PCI)
...@@ -3280,7 +3280,7 @@ static void iommu_detach_dependent_devices(struct intel_iommu *iommu, ...@@ -3280,7 +3280,7 @@ static void iommu_detach_dependent_devices(struct intel_iommu *iommu,
parent->devfn); parent->devfn);
parent = parent->bus->self; parent = parent->bus->self;
} }
if (tmp->is_pcie) /* this is a PCIE-to-PCI bridge */ if (pci_is_pcie(tmp)) /* this is a PCIE-to-PCI bridge */
iommu_detach_dev(iommu, iommu_detach_dev(iommu,
tmp->subordinate->number, 0); tmp->subordinate->number, 0);
else /* this is a legacy PCI bridge */ else /* this is a legacy PCI bridge */
......
...@@ -478,7 +478,7 @@ int set_msi_sid(struct irte *irte, struct pci_dev *dev) ...@@ -478,7 +478,7 @@ int set_msi_sid(struct irte *irte, struct pci_dev *dev)
return -1; return -1;
/* PCIe device or Root Complex integrated PCI device */ /* PCIe device or Root Complex integrated PCI device */
if (dev->is_pcie || !dev->bus->parent) { if (pci_is_pcie(dev) || !dev->bus->parent) {
set_irte_sid(irte, SVT_VERIFY_SID_SQ, SQ_ALL_16, set_irte_sid(irte, SVT_VERIFY_SID_SQ, SQ_ALL_16,
(dev->bus->number << 8) | dev->devfn); (dev->bus->number << 8) | dev->devfn);
return 0; return 0;
...@@ -486,7 +486,7 @@ int set_msi_sid(struct irte *irte, struct pci_dev *dev) ...@@ -486,7 +486,7 @@ int set_msi_sid(struct irte *irte, struct pci_dev *dev)
bridge = pci_find_upstream_pcie_bridge(dev); bridge = pci_find_upstream_pcie_bridge(dev);
if (bridge) { if (bridge) {
if (bridge->is_pcie) /* this is a PCIE-to-PCI/PCIX bridge */ if (pci_is_pcie(bridge))/* this is a PCIE-to-PCI/PCIX bridge */
set_irte_sid(irte, SVT_VERIFY_BUS, SQ_ALL_16, set_irte_sid(irte, SVT_VERIFY_BUS, SQ_ALL_16,
(bridge->bus->number << 8) | dev->bus->number); (bridge->bus->number << 8) | dev->bus->number);
else /* this is a legacy PCI bridge */ else /* this is a legacy PCI bridge */
......
...@@ -555,7 +555,7 @@ int pci_iov_init(struct pci_dev *dev) ...@@ -555,7 +555,7 @@ int pci_iov_init(struct pci_dev *dev)
{ {
int pos; int pos;
if (!dev->is_pcie) if (!pci_is_pcie(dev))
return -ENODEV; return -ENODEV;
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV); pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV);
......
...@@ -116,7 +116,7 @@ static void acpi_pci_propagate_wakeup_enable(struct pci_bus *bus, bool enable) ...@@ -116,7 +116,7 @@ static void acpi_pci_propagate_wakeup_enable(struct pci_bus *bus, bool enable)
int ret; int ret;
ret = acpi_pm_device_sleep_wake(&bridge->dev, enable); ret = acpi_pm_device_sleep_wake(&bridge->dev, enable);
if (!ret || bridge->is_pcie) if (!ret || pci_is_pcie(bridge))
return; return;
bus = bus->parent; bus = bus->parent;
} }
...@@ -131,7 +131,7 @@ static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable) ...@@ -131,7 +131,7 @@ static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable)
if (acpi_pci_can_wakeup(dev)) if (acpi_pci_can_wakeup(dev))
return acpi_pm_device_sleep_wake(&dev->dev, enable); return acpi_pm_device_sleep_wake(&dev->dev, enable);
if (!dev->is_pcie) if (!pci_is_pcie(dev))
acpi_pci_propagate_wakeup_enable(dev->bus, enable); acpi_pci_propagate_wakeup_enable(dev->bus, enable);
return 0; return 0;
......
...@@ -1524,7 +1524,7 @@ void pci_enable_ari(struct pci_dev *dev) ...@@ -1524,7 +1524,7 @@ void pci_enable_ari(struct pci_dev *dev)
u16 ctrl; u16 ctrl;
struct pci_dev *bridge; struct pci_dev *bridge;
if (!dev->is_pcie || dev->devfn) if (!pci_is_pcie(dev) || dev->devfn)
return; return;
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI); pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI);
...@@ -1532,7 +1532,7 @@ void pci_enable_ari(struct pci_dev *dev) ...@@ -1532,7 +1532,7 @@ void pci_enable_ari(struct pci_dev *dev)
return; return;
bridge = dev->bus->self; bridge = dev->bus->self;
if (!bridge || !bridge->is_pcie) if (!bridge || !pci_is_pcie(bridge))
return; return;
pos = pci_pcie_cap(bridge); pos = pci_pcie_cap(bridge);
...@@ -1560,7 +1560,7 @@ void pci_enable_acs(struct pci_dev *dev) ...@@ -1560,7 +1560,7 @@ void pci_enable_acs(struct pci_dev *dev)
u16 cap; u16 cap;
u16 ctrl; u16 ctrl;
if (!dev->is_pcie) if (!pci_is_pcie(dev))
return; return;
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS); pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS);
......
...@@ -26,14 +26,14 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev) ...@@ -26,14 +26,14 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
{ {
struct pci_dev *tmp = NULL; struct pci_dev *tmp = NULL;
if (pdev->is_pcie) if (pci_is_pcie(pdev))
return NULL; return NULL;
while (1) { while (1) {
if (pci_is_root_bus(pdev->bus)) if (pci_is_root_bus(pdev->bus))
break; break;
pdev = pdev->bus->self; pdev = pdev->bus->self;
/* a p2p bridge */ /* a p2p bridge */
if (!pdev->is_pcie) { if (!pci_is_pcie(pdev)) {
tmp = pdev; tmp = pdev;
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册