public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] MTD mtdchar: add missing initializer on raw write
@ 2011-06-06 13:50 Peter Wippich
  2011-06-06 15:28 ` Artem Bityutskiy
  2011-06-06 15:33 ` Artem Bityutskiy
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Wippich @ 2011-06-06 13:50 UTC (permalink / raw)
  To: linux-mtd


On writes in MODE_RAW the mtd_oob_ops struct is not sufficiently 
initialized which may cause nandwrite to fail. With this patch
it is possible to write raw nand/oob data without additional ECC
(either for testing or when some sectors need different oob layout
e.g. bootloader) like
nandwrite  -n -r -o  /dev/mtd0 <myfile>

Signed-off-by: Peter Wippich <pewi@gw-instruments.de>

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 3f92731..797a34a 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -321,6 +321,7 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count
                         ops.datbuf = kbuf;
                         ops.oobbuf = NULL;
                         ops.len = len;
+                       ops.ooboffs = 0;

                         ret = mtd->write_oob(mtd, *ppos, &ops);
                         retlen = ops.retlen;

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

end of thread, other threads:[~2011-06-07  9:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-06 13:50 [PATCH 1/1] MTD mtdchar: add missing initializer on raw write Peter Wippich
2011-06-06 15:28 ` Artem Bityutskiy
2011-06-07  9:28   ` Ricard Wanderlof
2011-06-07  9:38     ` Artem Bityutskiy
2011-06-06 15:33 ` Artem Bityutskiy
2011-06-06 15:39   ` Peter Wippich
2011-06-06 15:44     ` Artem Bityutskiy
2011-06-06 15:49       ` Peter Wippich

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