diff options
author | Yijing Wang <wangyijing@huawei.com> | 2012-07-24 05:20:03 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-08-23 11:40:57 -0400 |
commit | 62f87c0e31d646d5501edf4f7feb07d0ad689d80 (patch) | |
tree | f2aa208c10f6cf8b91634f91efda44efc6f4c25f /drivers/pci/pcie/aer | |
parent | 786e22885d9959fda0473ace5a61cb11620fba9b (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/aer')
-rw-r--r-- | drivers/pci/pcie/aer/aer_inject.c | 2 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.c | 7 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_acpi.c | 2 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c index 52229863e9fe..4e24cb8a94ae 100644 --- a/drivers/pci/pcie/aer/aer_inject.c +++ b/drivers/pci/pcie/aer/aer_inject.c | |||
@@ -288,7 +288,7 @@ static struct pci_dev *pcie_find_root_port(struct pci_dev *dev) | |||
288 | while (1) { | 288 | while (1) { |
289 | if (!pci_is_pcie(dev)) | 289 | if (!pci_is_pcie(dev)) |
290 | break; | 290 | break; |
291 | if (dev->pcie_type == PCI_EXP_TYPE_ROOT_PORT) | 291 | if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) |
292 | return dev; | 292 | return dev; |
293 | if (!dev->bus->self) | 293 | if (!dev->bus->self) |
294 | break; | 294 | break; |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 58ad7917553c..f7c62453ae00 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -81,10 +81,11 @@ bool pci_aer_available(void) | |||
81 | static int set_device_error_reporting(struct pci_dev *dev, void *data) | 81 | static int set_device_error_reporting(struct pci_dev *dev, void *data) |
82 | { | 82 | { |
83 | bool enable = *((bool *)data); | 83 | bool enable = *((bool *)data); |
84 | int type = pci_pcie_type(dev); | ||
84 | 85 | ||
85 | if ((dev->pcie_type == PCI_EXP_TYPE_ROOT_PORT) || | 86 | if ((type == PCI_EXP_TYPE_ROOT_PORT) || |
86 | (dev->pcie_type == PCI_EXP_TYPE_UPSTREAM) || | 87 | (type == PCI_EXP_TYPE_UPSTREAM) || |
87 | (dev->pcie_type == PCI_EXP_TYPE_DOWNSTREAM)) { | 88 | (type == PCI_EXP_TYPE_DOWNSTREAM)) { |
88 | if (enable) | 89 | if (enable) |
89 | pci_enable_pcie_error_reporting(dev); | 90 | pci_enable_pcie_error_reporting(dev); |
90 | else | 91 | else |
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c index 124f20ff11b2..5194a7d41730 100644 --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c | |||
@@ -60,7 +60,7 @@ static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data) | |||
60 | p = (struct acpi_hest_aer_common *)(hest_hdr + 1); | 60 | p = (struct acpi_hest_aer_common *)(hest_hdr + 1); |
61 | if (p->flags & ACPI_HEST_GLOBAL) { | 61 | if (p->flags & ACPI_HEST_GLOBAL) { |
62 | if ((pci_is_pcie(info->pci_dev) && | 62 | if ((pci_is_pcie(info->pci_dev) && |
63 | info->pci_dev->pcie_type == pcie_type) || bridge) | 63 | pci_pcie_type(info->pci_dev) == pcie_type) || bridge) |
64 | ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST); | 64 | ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST); |
65 | } else | 65 | } else |
66 | if (hest_match_pci(p, info->pci_dev)) | 66 | if (hest_match_pci(p, info->pci_dev)) |
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 0ca053538146..f55153489854 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -465,7 +465,7 @@ static pci_ers_result_t reset_link(struct pci_dev *dev) | |||
465 | 465 | ||
466 | if (driver && driver->reset_link) { | 466 | if (driver && driver->reset_link) { |
467 | status = driver->reset_link(udev); | 467 | status = driver->reset_link(udev); |
468 | } else if (udev->pcie_type == PCI_EXP_TYPE_DOWNSTREAM) { | 468 | } else if (pci_pcie_type(udev) == PCI_EXP_TYPE_DOWNSTREAM) { |
469 | status = default_downstream_reset_link(udev); | 469 | status = default_downstream_reset_link(udev); |
470 | } else { | 470 | } else { |
471 | dev_printk(KERN_DEBUG, &dev->dev, | 471 | dev_printk(KERN_DEBUG, &dev->dev, |