[PATCH] mtd: of: put master offset into partition name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux