Sometimes, an special partition is included in the device tree including all the
partitions. Like in:

partit...@ff000000 {
       reg = < 0x000000 0x800000 >;
       label = "Root File System";
};
partit...@ff800000 {
       reg = < 0x800000 0x1a0000 >;
       label = "Bitstream";
};
...
partition...@ff000000 {
       reg = < 0x000000 0x1000000 >;
       label = "Full FLASH";
};

Because two nodes of a device tree cannot have the same name, but all the
partitions must be named "partition", this special partition is invalid.

This patch makes ofpart.c only check for the firt part of the name, and
ignore the rest, allowing this special partition.


---

The extra partition is quite useful while formating the full firmware from linux

v2, removes the -1 <Peter Korsgaard>

 drivers/mtd/ofpart.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 3e164f0..0af3b07 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -48,7 +48,7 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
 
                /* check if this is a partition node */
                partname = of_get_property(pp, "name", &len);
-               if (strcmp(partname, "partition") != 0) {
+               if (strncmp(partname, "partition", strlen("partition") != 0) {
                        nr_parts--;
                        continue;
                }
-- 
1.6.2.4

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to