summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-05 19:24:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-07 09:22:02 +0100
commit381fd6f56e7c07369e9dd11e649eeb3e21964935 (patch)
tree7e9264c41fe1768080232a8d81cb920fd88b0a8f /drivers/mtd
parentbf96d05b2b06d361429e35eed014449354100da4 (diff)
downloadbarebox-381fd6f56e7c07369e9dd11e649eeb3e21964935.tar.gz
barebox-381fd6f56e7c07369e9dd11e649eeb3e21964935.tar.xz
mtd nand: allow partial page writes
The nand layer handles partial page writes just fine. If the start or end of the data is not page aligned, the nand layer will copy the data to a temporary page buffer. Remove the check which disallows partial page writes since this is what we want to do on barebox when for example an image is written to nand which is not padded to page size. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_write.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/mtd/nand/nand_write.c b/drivers/mtd/nand/nand_write.c
index 5ed04cee57..999712795c 100644
--- a/drivers/mtd/nand/nand_write.c
+++ b/drivers/mtd/nand/nand_write.c
@@ -273,13 +273,6 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
if (!writelen)
return 0;
- /* reject writes, which are not page aligned */
- if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
- printk(KERN_NOTICE "nand_write: "
- "Attempt to write not page aligned data\n");
- return -EINVAL;
- }
-
column = to & (mtd->writesize - 1);
subpage = column || (writelen & (mtd->writesize - 1));