diff options
author | Benjamin Krill <ben@codiert.org> | 2009-01-23 11:18:05 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-03-24 10:04:20 -0400 |
commit | 4b08e149c0e02e97ec49c2a31d14a0d3a02f8074 (patch) | |
tree | 2e09a06d3513913450ee639d00fa6a384044bc1f | |
parent | c0e6616ae69774f42fda7a8cc5dc699aff311b40 (diff) |
[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>
-rw-r--r-- | drivers/mtd/ofpart.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 9e45b3f39c0e..3e164f0c9295 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c | |||
@@ -46,6 +46,13 @@ int __devinit of_mtd_parse_partitions(struct device *dev, | |||
46 | const u32 *reg; | 46 | const u32 *reg; |
47 | int len; | 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 | reg = of_get_property(pp, "reg", &len); | 56 | reg = of_get_property(pp, "reg", &len); |
50 | if (!reg || (len != 2 * sizeof(u32))) { | 57 | if (!reg || (len != 2 * sizeof(u32))) { |
51 | of_node_put(pp); | 58 | of_node_put(pp); |