diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-09-17 22:25:33 -0700 |
---|---|---|
committer | Yinghai Lu <yinghai@kernel.org> | 2012-09-17 22:25:33 -0700 |
commit | 6756093252d7e9971da15460205285a7dcd8222c (patch) | |
tree | 4ad69479e2820657897f558d29c8373316499017 | |
parent | 010b7cf5a7bd5f7a2acd84355e55f013061d8b38 (diff) | |
download | linux-yinghai-6756093252d7e9971da15460205285a7dcd8222c.tar.gz |
PCI: Add pcibios_bus_addr_to_res()
it takes addr and return converted address only.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
-rw-r--r-- | drivers/pci/host-bridge.c | 14 | ||||
-rw-r--r-- | include/linux/pci.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index 2e7288be0d56e9..c911adb902cc44 100644 --- a/drivers/pci/host-bridge.c +++ b/drivers/pci/host-bridge.c @@ -102,3 +102,17 @@ void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, __pcibios_bus_to_resource(dev->bus, res, region); } EXPORT_SYMBOL(pcibios_bus_to_resource); + +resource_size_t pcibios_bus_addr_to_res(struct pci_bus *bus, int flags, + resource_size_t addr) +{ + struct pci_bus_region region; + struct resource r; + + r.flags = flags; + region.start = addr; + region.end = addr; + __pcibios_bus_to_resource(bus, &r, ®ion); + + return r.end; +} diff --git a/include/linux/pci.h b/include/linux/pci.h index fc9187449c3b27..ae020d48351dd9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -773,6 +773,8 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res); void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +resource_size_t pcibios_bus_addr_to_res(struct pci_bus *bus, int flags, + resource_size_t addr); void pcibios_scan_specific_bus(int busn); extern struct pci_bus *pci_find_bus(int domain, int busnr); void pci_bus_add_devices(const struct pci_bus *bus); |