[PATCH] powerpc: fix OF pci flags parsing

Olof Johansson olof at lixom.net
Tue Nov 28 14:21:29 EST 2006


For PCI devices with only io ports, of_bus_pci_get_flags() will fall
through and still mark the resource as IORESOURCE_MEM.


Signed-off-by: Olof Johansson <olof at lixom.net>

---

This should be fine to hold until 2.6.20, since noone (as far as I
know) has hit it in the wild.


diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 346fb7b..0dfbe1c 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -160,9 +160,11 @@ static unsigned int of_bus_pci_get_flags
 	switch((w >> 24) & 0x03) {
 	case 0x01:
 		flags |= IORESOURCE_IO;
+		break;
 	case 0x02: /* 32 bits */
 	case 0x03: /* 64 bits */
 		flags |= IORESOURCE_MEM;
+		break;
 	}
 	if (w & 0x40000000)
 		flags |= IORESOURCE_PREFETCH;



More information about the Linuxppc-dev mailing list