Commit 4b08e149c0e02e97ec49c2a31d14a0d3a02f8074
Committed by
David Woodhouse
1 parent
c0e6616ae6
Exists in
master
and in
39 other branches
[MTD] ofpart: Check name property to determine partition nodes.
SLOF has a further node which could not be evaluated by the current routine. The current routine returns because the node hasn't the required reg property. As fix this patch adds a check to determine the partition child nodes. If the node is not a partition the number of total partitions will be decreased and loop continues with the next nodes. Signed-off-by: Benjamin Krill <ben@codiert.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff
drivers/mtd/ofpart.c
... | ... | @@ -46,6 +46,13 @@ |
46 | 46 | const u32 *reg; |
47 | 47 | int len; |
48 | 48 | |
49 | + /* check if this is a partition node */ | |
50 | + partname = of_get_property(pp, "name", &len); | |
51 | + if (strcmp(partname, "partition") != 0) { | |
52 | + nr_parts--; | |
53 | + continue; | |
54 | + } | |
55 | + | |
49 | 56 | reg = of_get_property(pp, "reg", &len); |
50 | 57 | if (!reg || (len != 2 * sizeof(u32))) { |
51 | 58 | of_node_put(pp); |