linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [MTD] ofpart: Partitions at same address cannot have the same name
@ 2009-04-22  8:05 Ricardo Ribalda Delgado
  2009-04-22  9:24 ` Peter Korsgaard
  2009-04-30  3:19 ` [MTD] " Benjamin Herrenschmidt
  0 siblings, 2 replies; 13+ messages in thread
From: Ricardo Ribalda Delgado @ 2009-04-22  8:05 UTC (permalink / raw)
  To: linuxppc-dev, ben, David.Woodhouse, linuxppc-embedded
  Cc: Ricardo Ribalda Delgado

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

partition@ff000000 {
	reg = < 0x000000 0x800000 >;
	label = "Root File System";
};
partition@ff800000 {
	reg = < 0x800000 0x1a0000 >;
	label = "Bitstream";
};
...
partitionAll@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

 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,8 @@ 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")-1)
+									!= 0) {
 			nr_parts--;
 			continue;
 		}
-- 
1.6.2.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-04-30  5:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-22  8:05 [MTD] ofpart: Partitions at same address cannot have the same name Ricardo Ribalda Delgado
2009-04-22  9:24 ` Peter Korsgaard
2009-04-22 15:34   ` Ricardo Ribalda Delgado
2009-04-22 15:52   ` Ricardo Ribalda Delgado
2009-04-22 17:10     ` Benjamin Krill
2009-04-22 17:27       ` Scott Wood
2009-04-22 17:56         ` Ricardo Ribalda Delgado
2009-04-22 18:11           ` Scott Wood
2009-04-22 18:58             ` Ricardo Ribalda Delgado
2009-04-22 17:59       ` Ricardo Ribalda Delgado
2009-04-22 18:33         ` Benjamin Krill
2009-04-30  3:19 ` [MTD] " Benjamin Herrenschmidt
2009-04-30  5:32   ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).