diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-11-28 10:15:52 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-11-29 19:05:09 -0500 |
commit | 6ffa2489c51da77564a0881a73765ea2169f955d (patch) | |
tree | b78c596c4a138a156cf5cfe908ae161f1cdbe552 /drivers/pci/setup-res.c | |
parent | 45d004f4afefdd8d79916ee6d97a9ecd94bb1ffe (diff) |
PCI: Separate VF BAR updates from standard BAR updates
Previously pci_update_resource() used the same code path for updating
standard BARs and VF BARs in SR-IOV capabilities.
Split the VF BAR update into a new pci_iov_update_resource() internal
interface, which makes it simpler to compute the BAR address (we can get
rid of pci_resource_bar() and pci_iov_resource_bar()).
This patch:
- Renames pci_update_resource() to pci_std_update_resource(),
- Adds pci_iov_update_resource(),
- Makes pci_update_resource() a wrapper that calls the appropriate one,
No functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r-- | drivers/pci/setup-res.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 53bc0638cac6..5ddeb6737f99 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -25,8 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include "pci.h" | 26 | #include "pci.h" |
27 | 27 | ||
28 | 28 | static void pci_std_update_resource(struct pci_dev *dev, int resno) | |
29 | void pci_update_resource(struct pci_dev *dev, int resno) | ||
30 | { | 29 | { |
31 | struct pci_bus_region region; | 30 | struct pci_bus_region region; |
32 | bool disable; | 31 | bool disable; |
@@ -114,6 +113,16 @@ void pci_update_resource(struct pci_dev *dev, int resno) | |||
114 | pci_write_config_word(dev, PCI_COMMAND, cmd); | 113 | pci_write_config_word(dev, PCI_COMMAND, cmd); |
115 | } | 114 | } |
116 | 115 | ||
116 | void pci_update_resource(struct pci_dev *dev, int resno) | ||
117 | { | ||
118 | if (resno <= PCI_ROM_RESOURCE) | ||
119 | pci_std_update_resource(dev, resno); | ||
120 | #ifdef CONFIG_PCI_IOV | ||
121 | else if (resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END) | ||
122 | pci_iov_update_resource(dev, resno); | ||
123 | #endif | ||
124 | } | ||
125 | |||
117 | int pci_claim_resource(struct pci_dev *dev, int resource) | 126 | int pci_claim_resource(struct pci_dev *dev, int resource) |
118 | { | 127 | { |
119 | struct resource *res = &dev->resource[resource]; | 128 | struct resource *res = &dev->resource[resource]; |