projects
/
yaffs2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
1dd2d19
)
Clean up parameters being passed to mtd
author
Charles Manning
<cdhmanning@gmail.com>
Mon, 24 Jun 2013 05:13:30 +0000
(17:13 +1200)
committer
Charles Manning
<cdhmanning@gmail.com>
Mon, 24 Jun 2013 05:13:30 +0000
(17:13 +1200)
Some nand implementations are fussy about the parameters being passed in.
If the ptr or length of data or oob is zero, then clear out the whole
parameter pair.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs_mtdif_multi.c
patch
|
blob
|
history
diff --git
a/yaffs_mtdif_multi.c
b/yaffs_mtdif_multi.c
index 265dd789eb02d55094277183adf7cf722ecfd092..fe91a9eb3d97f35d08552ba59d5c7c9958999328 100644
(file)
--- a/
yaffs_mtdif_multi.c
+++ b/
yaffs_mtdif_multi.c
@@
-78,6
+78,20
@@
static int yaffs_mtd_write(struct yaffs_dev *dev, int nand_chunk,
struct mtd_oob_ops ops;
int retval;
+ yaffs_trace(YAFFS_TRACE_MTD,
+ "yaffs_mtd_write(%p, %d, %p, %d, %p, %d)\n",
+ dev, nand_chunk, data, data_len, oob, oob_len);
+
+ if (!data || !data_len) {
+ data = NULL;
+ data_len = 0;
+ }
+
+ if (!oob || !oob_len) {
+ oob = NULL;
+ oob_len = 0;
+ }
+
addr = ((loff_t) nand_chunk) * dev->param.total_bytes_per_chunk;
memset(&ops, 0, sizeof(ops));
ops.mode = MTD_OPS_AUTO_OOB;