diff options
author | Yinghai Lu <yinghai@kernel.org> | 2013-12-10 01:54:40 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-21 12:06:10 -0500 |
commit | fc2798502f860b18f3c7121e4dc659d3d9d28d74 (patch) | |
tree | d15d6addb41d305e33c6f6d8e363b7272dc29a38 /arch/sparc | |
parent | 0a5ef7b914be91dd257ae4f35223dd822dd3703a (diff) |
PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev
These interfaces:
pcibios_resource_to_bus(struct pci_dev *dev, *bus_region, *resource)
pcibios_bus_to_resource(struct pci_dev *dev, *resource, *bus_region)
took a pci_dev, but they really depend only on the pci_bus. And we want to
use them in resource allocation paths where we have the bus but not a
device, so this patch converts them to take the pci_bus instead of the
pci_dev:
pcibios_resource_to_bus(struct pci_bus *bus, *bus_region, *resource)
pcibios_bus_to_resource(struct pci_bus *bus, *resource, *bus_region)
In fact, with standard PCI-PCI bridges, they only depend on the host
bridge, because that's the only place address translation occurs, but
we aren't going that far yet.
[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index cb021453de2a..7de8d1f590b7 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -392,7 +392,7 @@ static void apb_fake_ranges(struct pci_dev *dev, | |||
392 | res->flags = IORESOURCE_IO; | 392 | res->flags = IORESOURCE_IO; |
393 | region.start = (first << 21); | 393 | region.start = (first << 21); |
394 | region.end = (last << 21) + ((1 << 21) - 1); | 394 | region.end = (last << 21) + ((1 << 21) - 1); |
395 | pcibios_bus_to_resource(dev, res, ®ion); | 395 | pcibios_bus_to_resource(dev->bus, res, ®ion); |
396 | 396 | ||
397 | pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map); | 397 | pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map); |
398 | apb_calc_first_last(map, &first, &last); | 398 | apb_calc_first_last(map, &first, &last); |
@@ -400,7 +400,7 @@ static void apb_fake_ranges(struct pci_dev *dev, | |||
400 | res->flags = IORESOURCE_MEM; | 400 | res->flags = IORESOURCE_MEM; |
401 | region.start = (first << 29); | 401 | region.start = (first << 29); |
402 | region.end = (last << 29) + ((1 << 29) - 1); | 402 | region.end = (last << 29) + ((1 << 29) - 1); |
403 | pcibios_bus_to_resource(dev, res, ®ion); | 403 | pcibios_bus_to_resource(dev->bus, res, ®ion); |
404 | } | 404 | } |
405 | 405 | ||
406 | static void pci_of_scan_bus(struct pci_pbm_info *pbm, | 406 | static void pci_of_scan_bus(struct pci_pbm_info *pbm, |
@@ -491,7 +491,7 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm, | |||
491 | res->flags = flags; | 491 | res->flags = flags; |
492 | region.start = GET_64BIT(ranges, 1); | 492 | region.start = GET_64BIT(ranges, 1); |
493 | region.end = region.start + size - 1; | 493 | region.end = region.start + size - 1; |
494 | pcibios_bus_to_resource(dev, res, ®ion); | 494 | pcibios_bus_to_resource(dev->bus, res, ®ion); |
495 | } | 495 | } |
496 | after_ranges: | 496 | after_ranges: |
497 | sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), | 497 | sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), |