powerpc/bootwrapper: Use the child-bus #address-cells to decide which range entry...
authorScott Wood <scottwood@freescale.com>
Fri, 19 Dec 2008 10:13:09 +0000 (10:13 +0000)
committerPaul Mackerras <paulus@samba.org>
Sun, 21 Dec 2008 03:21:17 +0000 (14:21 +1100)
The correct #address-cells was still used for the actual translation,
so the impact is only a possibility of choosing the wrong range entry
or failing to find any match.  Most common cases were not affected.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/boot/devtree.c

index 5d12336dc3609d9d0cb9df0089f273ffc7fabe77..a7e21a35c03af6a7bd584cccf6b140f85157d7cf 100644 (file)
@@ -213,7 +213,7 @@ static int find_range(u32 *reg, u32 *ranges, int nregaddr,
                u32 range_addr[MAX_ADDR_CELLS];
                u32 range_size[MAX_ADDR_CELLS];
 
-               copy_val(range_addr, ranges + i, naddr);
+               copy_val(range_addr, ranges + i, nregaddr);
                copy_val(range_size, ranges + i + nregaddr + naddr, nsize);
 
                if (compare_reg(reg, range_addr, range_size))