mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: barebox@lists.infradead.org
Subject: [RFC] mtd: core: set cdev offset
Date: Thu, 11 Oct 2018 18:42:17 +0200	[thread overview]
Message-ID: <20181011164216.GB21891@lenoch> (raw)

Recently added check for overlapping environment always succeeds [*]
for mtd partitions not starting at the beginning of flash as
cdev.offset is not set. Here's a proposed fix, however someone
familiar with codebase should verify/correct this oneliner.

Thank you.

[*] Environment partition (0x00000000-0x000020ff) overlaps with partition dataflash0.at91bootstrap (0x00000000-0x000041ff), not using it
    where "Environment partition" actually starts at 0x4200.
---
 drivers/mtd/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 58b20cbc2..b40a3303c 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -640,6 +640,7 @@ int add_mtd_device(struct mtd_info *mtd, const char *devname, int device_id)
 
 	mtd->cdev.ops = &mtd_ops;
 	mtd->cdev.size = mtd->size;
+	mtd->cdev.offset = mtd->master_offset;
 	if (device_id == DEVICE_ID_SINGLE)
 		mtd->cdev.name = xstrdup(devname);
 	else
-- 
2.19.1


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

             reply	other threads:[~2018-10-11 16:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 16:42 Ladislav Michl [this message]
2018-10-11 23:37 ` Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011164216.GB21891@lenoch \
    --to=ladis@linux-mips.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox