[PATCH] powerpc: pci_address_to_pio fix

This fixes pci_address_to_pio() to return an unsigned long (to be safe)
and fixes a bug in the implementation that caused it to return a bogus
IO port number

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Benjamin Herrenschmidt
2005-12-15 15:00:57 +11:00
committed by Paul Mackerras
parent a04c8780fd
commit f2c4583a38
5 changed files with 20 additions and 17 deletions

View File

@ -503,9 +503,9 @@ static int __of_address_to_resource(struct device_node *dev, u32 *addrp,
return -EINVAL;
memset(r, 0, sizeof(struct resource));
if (flags & IORESOURCE_IO) {
unsigned int port;
unsigned long port;
port = pci_address_to_pio(taddr);
if (port == (unsigned int)-1)
if (port == (unsigned long)-1)
return -EINVAL;
r->start = port;
r->end = port + size - 1;