Re: [PATCH] PCI and PCI Hotplug fixes for 2.6.5-rc1

From: Greg KH
Date: Fri Mar 19 2004 - 18:34:13 EST


ChangeSet 1.1608.97.6, 2004/03/19 14:08:16-08:00, willy@xxxxxxxxxx

[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.


drivers/pci/setup-res.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)


diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c Fri Mar 19 15:21:11 2004
+++ b/drivers/pci/setup-res.c Fri Mar 19 15:21:11 2004
@@ -94,13 +94,18 @@
pci_claim_resource(struct pci_dev *dev, int 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";
int err;

+ if (res->flags & IORESOURCE_IO)
+ root = &ioport_resource;
+ if (res->flags & IORESOURCE_MEM)
+ root = &iomem_resource;
+
err = -EINVAL;
if (root != NULL)
- err = request_resource(root, res);
+ err = insert_resource(root, res);

if (err) {
printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n",

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/