From a60c146bc866a95ef1f2e8be946954c0fa9064a8 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 26 Jul 2007 13:44:36 +1000 Subject: [PATCH] Revert "[POWERPC] Don't complain if size-cells == 0 in prom_parse()" This reverts commit 8446c7323dc47b40740fea1698e56b6d40e73163. Having #size-cells == 0 in a node indicates that things under the node aren't directly accessible, and therefore we shouldn't try to translate addresses for devices under the node into CPU physical addresses. Some drivers, such as the nvram driver for powermacs, rely on of_address_to_resource failing if they are called for a node representing a device whose resources aren't directly accessible by the CPU. These drivers were broken by commit 8446c732, resulting in the "Lombard" powerbook hanging early in the boot process. Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/prom_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 3786dcc8a7b62..b5c96af955c63 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c @@ -24,7 +24,7 @@ /* Max address size we deal with */ #define OF_MAX_ADDR_CELLS 4 #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ - (ns) >= 0) + (ns) > 0) static struct of_bus *of_match_bus(struct device_node *np); static int __of_address_to_resource(struct device_node *dev, -- 2.39.5