===================================================================
@@ -1006,7 +1006,7 @@ static void pcibios_allocate_bus_resourc
* and as such ensure proper re-allocation
* later.
*/
- pr = pci_find_parent_resource(bus->self, res);
+ pr = pci_find_parent_resource(bus->self->bus, res);
if (pr == res) {
/* this happens when the generic PCI
* code (wrongly) decides that this
@@ -1064,7 +1064,7 @@ static inline void alloc_resource(struct
(unsigned long long)r->end,
(unsigned int)r->flags);
- pr = pci_find_parent_resource(dev, r);
+ pr = pci_find_parent_resource(dev->bus, r);
if (!pr || (pr->flags & IORESOURCE_UNSET) ||
request_resource(pr, r) < 0) {
pr_warn("PCI: Cannot allocate resource region %d ", idx);
===================================================================
@@ -1180,7 +1180,7 @@ static void pcibios_allocate_bus_resourc
pr = (res->flags & IORESOURCE_IO) ?
&ioport_resource : &iomem_resource;
else {
- pr = pci_find_parent_resource(bus->self, res);
+ pr = pci_find_parent_resource(bus->self->bus, res);
if (pr == res) {
/* this happens when the generic PCI
* code (wrongly) decides that this
@@ -1237,7 +1237,7 @@ static inline void alloc_resource(struct
pr_debug("PCI: Allocating %s: Resource %d: %pR\n",
pci_name(dev), idx, r);
- pr = pci_find_parent_resource(dev, r);
+ pr = pci_find_parent_resource(dev->bus, r);
if (!pr || (pr->flags & IORESOURCE_UNSET) ||
request_resource(pr, r) < 0) {
printk(KERN_WARNING "PCI: Cannot allocate resource region %d"
===================================================================
@@ -417,16 +417,15 @@ EXPORT_SYMBOL_GPL(pci_find_ht_capability
/**
* pci_find_parent_resource - return resource region of parent bus of
given region
- * @dev: PCI device structure contains resources to be searched
+ * @bus: PCI bus structure contains resources to be searched
* @res: child resource record for which parent is sought
*
* For given resource region of given device, return the resource
* region of parent bus the given region is contained in.
*/
-struct resource *pci_find_parent_resource(const struct pci_dev *dev,
+struct resource *pci_find_parent_resource(const struct pci_bus *bus,
struct resource *res)
{
- const struct pci_bus *bus = dev->bus;
struct resource *r;
int i;
===================================================================
@@ -121,7 +121,7 @@ int pci_claim_resource(struct pci_dev *d
return -EINVAL;
}
- root = pci_find_parent_resource(dev, res);
+ root = pci_find_parent_resource(dev->bus, res);
if (!root) {
dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible
bridge window\n",
resource, res);
@@ -184,7 +184,7 @@ static int pci_revert_fw_address(struct
res->end = res->start + size - 1;
res->flags &= ~IORESOURCE_UNSET;
- root = pci_find_parent_resource(dev, res);
+ root = pci_find_parent_resource(dev->bus, res);
if (!root) {
if (res->flags & IORESOURCE_IO)
root = &ioport_resource;
===================================================================
@@ -84,7 +84,7 @@ claim_region(struct pcmcia_socket *s, re
if (res) {
#ifdef CONFIG_PCI
if (s && s->cb_dev)
- parent = pci_find_parent_resource(s->cb_dev, res);
+ parent = pci_find_parent_resource(s->cb_dev->bus, res);
#endif
if (!parent || request_resource(parent, res)) {
kfree(res);
===================================================================
@@ -818,7 +818,7 @@ void pci_device_add(struct pci_dev *dev,
unsigned int pci_scan_child_bus(struct pci_bus *bus);
void pci_bus_add_device(struct pci_dev *dev);
void pci_read_bridge_bases(struct pci_bus *child);
-struct resource *pci_find_parent_resource(const struct pci_dev *dev,
+struct resource *pci_find_parent_resource(const struct pci_bus *bus,
struct resource *res);
u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);
int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);