Commit a3ebf704 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Greg Kroah-Hartman

[PATCH] PCI: Use insert_resource in pci_claim_resource

On ia64, the parent resources are not necessarily PCI resources and
so won't get found by pci_find_parent_resource.  Use the shiny new
insert_resource() function instead, which I think we would have used
here had it been available at the time.
parent 78b21ca0
...@@ -94,13 +94,18 @@ int __init ...@@ -94,13 +94,18 @@ int __init
pci_claim_resource(struct pci_dev *dev, int resource) pci_claim_resource(struct pci_dev *dev, int resource)
{ {
struct resource *res = &dev->resource[resource]; struct resource *res = &dev->resource[resource];
struct resource *root = pci_find_parent_resource(dev, res); struct resource *root = NULL;
char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
int err; int err;
if (res->flags & IORESOURCE_IO)
root = &ioport_resource;
if (res->flags & IORESOURCE_MEM)
root = &iomem_resource;
err = -EINVAL; err = -EINVAL;
if (root != NULL) if (root != NULL)
err = request_resource(root, res); err = insert_resource(root, res);
if (err) { if (err) {
printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n", printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment