From: Russell King <rmk-pci@arm.linux.org.uk>

pci_assign_resource reports odd messages when resource allocation fails. 
This is because res->end and res->start are modified by allocate_resource. 
For example:

PCI: Failed to allocate resource 1(0-ffffffff) for 0000:00:01.0

The following patch reports whether it's an IO or memory resource, and
includes the correct size.  For consistency, we report it in a similar way
to the failure message in pci_request_region(), even though res->start is
unlikely to be useful.



---

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

diff -puN drivers/pci/setup-res.c~resource-allocation-reporting-fix drivers/pci/setup-res.c
--- 25/drivers/pci/setup-res.c~resource-allocation-reporting-fix	2004-02-20 13:52:30.000000000 -0800
+++ 25-akpm/drivers/pci/setup-res.c	2004-02-20 13:52:30.000000000 -0800
@@ -143,8 +143,9 @@ int pci_assign_resource(struct pci_dev *
 	}
 
 	if (ret) {
-		printk(KERN_ERR "PCI: Failed to allocate resource %d(%lx-%lx) for %s\n",
-		       resno, res->start, res->end, pci_name(dev));
+		printk(KERN_ERR "PCI: Failed to allocate %s resource #%d:%lx@%lx for %s\n",
+		       res->flags & IORESOURCE_IO ? "I/O" : "mem",
+		       resno, size, res->start, pci_name(dev));
 	} else if (resno < PCI_BRIDGE_RESOURCES) {
 		pci_update_resource(dev, res, resno);
 	}

_