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/iov.c | |
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/iov.c')
-rw-r--r-- | drivers/pci/iov.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 74bbaf82638d..aeccc911abb8 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
@@ -433,8 +433,8 @@ static int sriov_init(struct pci_dev *dev, int pos) | |||
433 | struct resource *res; | 433 | struct resource *res; |
434 | struct pci_dev *pdev; | 434 | struct pci_dev *pdev; |
435 | 435 | ||
436 | if (dev->pcie_type != PCI_EXP_TYPE_RC_END && | 436 | if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END && |
437 | dev->pcie_type != PCI_EXP_TYPE_ENDPOINT) | 437 | pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT) |
438 | return -ENODEV; | 438 | return -ENODEV; |
439 | 439 | ||
440 | pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl); | 440 | pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl); |
@@ -503,7 +503,7 @@ found: | |||
503 | iov->self = dev; | 503 | iov->self = dev; |
504 | pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap); | 504 | pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap); |
505 | pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link); | 505 | pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link); |
506 | if (dev->pcie_type == PCI_EXP_TYPE_RC_END) | 506 | if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END) |
507 | iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link); | 507 | iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link); |
508 | 508 | ||
509 | if (pdev) | 509 | if (pdev) |