summaryrefslogtreecommitdiff
path: root/drivers/pci/setup-res.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-03-17 00:48:23 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-22 12:43:36 +0100
commit7b65c3a84311026200b19eb86c9a76ff004402f8 (patch)
tree7ba52acc6de79a486c1666257af591e51c97cd88 /drivers/pci/setup-res.c
parent6a5f3e664ac798b54448fc55e7e7c3a9fd1ee9d4 (diff)
PCI: Remove pci_resource_bar() and pci_iov_resource_bar()
[ Upstream commit 286c2378aaccc7343ebf17ec6cd86567659caf70 ] pci_std_update_resource() only deals with standard BARs, so we don't have to worry about the complications of VF BARs in an SR-IOV capability. Compute the BAR address inline and remove pci_resource_bar(). That makes pci_iov_resource_bar() unused, so remove that as well. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r--drivers/pci/setup-res.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 695f32daf466..182d0f065a42 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -32,7 +32,6 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
u16 cmd;
u32 new, check, mask;
int reg;
- enum pci_bar_type type;
struct resource *res = dev->resource + resno;
if (dev->is_virtfn) {
@@ -66,14 +65,16 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
else
mask = (u32)PCI_BASE_ADDRESS_MEM_MASK;
- reg = pci_resource_bar(dev, resno, &type);
- if (!reg)
- return;
- if (type != pci_bar_unknown) {
+ if (resno < PCI_ROM_RESOURCE) {
+ reg = PCI_BASE_ADDRESS_0 + 4 * resno;
+ } else if (resno == PCI_ROM_RESOURCE) {
if (!(res->flags & IORESOURCE_ROM_ENABLE))
return;
+
+ reg = dev->rom_base_reg;
new |= PCI_ROM_ADDRESS_ENABLE;
- }
+ } else
+ return;
/*
* We can't update a 64-bit BAR atomically, so when possible,