mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: of: put master offset into partition name
@ 2015-07-23 13:17 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2015-07-23 13:17 UTC (permalink / raw)
  To: Barebox List

Partition names should be partition@<offset> with <offset> being the
offset in the master mtd, and not a counting number.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 3bdf441..d873369 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -491,7 +491,7 @@ static int of_mtd_fixup(struct device_node *root, void *ctx)
 {
 	struct mtd_info *mtd = ctx, *partmtd;
 	struct device_node *np, *part, *tmp;
-	int ret, i = 0;
+	int ret;
 
 	np = of_find_node_by_path_from(root, mtd->of_path);
 	if (!np) {
@@ -508,7 +508,7 @@ static int of_mtd_fixup(struct device_node *root, void *ctx)
 
 	list_for_each_entry(partmtd, &mtd->partitions, partitions_entry) {
 		int na, ns, len = 0;
-		char *name = asprintf("partition@%d", i++);
+		char *name = asprintf("partition@%0llx", partmtd->master_offset);
 		void *p;
 		u8 tmp[16 * 16]; /* Up to 64-bit address + 64-bit size */
 
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-23 13:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 13:17 [PATCH] mtd: of: put master offset into partition name Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox