powerpc/mm: Fix node look up with numa=off boot
[linux-2.6-block.git] / arch / powerpc / mm / numa.c
index b1ecfb850b5a9978a43bb63cb19df99de09a7e75..a62bc9861e4ebb6e99caded5c34a85e95fdac921 100644 (file)
@@ -232,7 +232,7 @@ static int associativity_to_nid(const __be32 *associativity)
 {
        int nid = NUMA_NO_NODE;
 
-       if (min_common_depth == -1)
+       if (min_common_depth == -1 || !numa_enabled)
                goto out;
 
        if (of_read_number(associativity, 1) >= min_common_depth)
@@ -440,7 +440,7 @@ static int of_drconf_to_nid_single(struct drmem_lmb *lmb)
        int nid = default_nid;
        int rc, index;
 
-       if (min_common_depth < 0)
+       if ((min_common_depth < 0) || !numa_enabled)
                return default_nid;
 
        rc = of_get_assoc_arrays(&aa);
@@ -830,7 +830,7 @@ static void __init find_possible_nodes(void)
        struct device_node *rtas;
        u32 numnodes, i;
 
-       if (min_common_depth <= 0)
+       if (min_common_depth <= 0 || !numa_enabled)
                return;
 
        rtas = of_find_node_by_path("/rtas");