of: Support matching cpu nodes with no 'reg' property
authorRob Herring <robh@kernel.org>
Mon, 27 Aug 2018 18:46:51 +0000 (13:46 -0500)
committerRob Herring <robh@kernel.org>
Fri, 28 Sep 2018 19:25:58 +0000 (14:25 -0500)
For some single core ARM systems, the DTs can have a single cpu node
without a reg property and #address-cells == 0. This case is valid and
should match on cpu #0.

Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/base.c

index 4807db0..bd51d21 100644 (file)
@@ -327,6 +327,8 @@ static bool __of_find_n_match_cpu_property(struct device_node *cpun,
 
        ac = of_n_addr_cells(cpun);
        cell = of_get_property(cpun, prop_name, &prop_len);
+       if (!cell && !ac && arch_match_cpu_phys_id(cpu, 0))
+               return true;
        if (!cell || !ac)
                return false;
        prop_len /= sizeof(*cell) * ac;