of: Fix reproducible names for #address-cells != 1
For the new "fixed-partitions" binding we ignore the partitions
subnode for creating reproducible names and set node to its parent.
To get the number of address cells we must call of_n_addr_cells()
before setting node to its parent though, not afterwards. With the
current behaviour we always get OF_ROOT_NODE_ADDR_CELLS_DEFAULT (=1).
This happens to work then the partitioned device is less than 4GiB
in size. On bigger devices #address-cells = <2> is chosen by the
mtd partition fixup code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Bastian Krause <bst@pengutronix.de>
1 parent c00193a commit 8e48593dfaaf024613a9c0f8a30a1eaae68392a2
@Sascha Hauer Sascha Hauer authored on 18 Mar 2019
Showing 1 changed file
View
drivers/of/base.c