summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-12-10 15:46:12 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-12-11 09:18:10 +0100
commitbadb59f0309a4269f420173463ef4e6c2bc4d199 (patch)
tree2a9a22134152adc14c7946792197eaf26c11f9aa
parent71fe101b17ef13f764e501d2b8e516396c61f5a4 (diff)
downloadbarebox-badb59f0309a4269f420173463ef4e6c2bc4d199.tar.gz
barebox-badb59f0309a4269f420173463ef4e6c2bc4d199.tar.xz
mtd: nand: Allow non page aligned length writes
When copying images to nand with plain cp it can happen that the length of the image is not page aligned. Allow misaligned image lengths as we used to before the last NAND layer update. Fixes: b6bcd96de5 ("mtd: nand: Update to Linux-5.9") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/mtd/nand/nand_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 2c3c0b360f..e190db7308 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -4031,7 +4031,7 @@ static int nand_do_write_ops(struct nand_chip *chip, loff_t to,
return 0;
/* Reject writes, which are not page aligned */
- if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
+ if (NOTALIGNED(to)) {
pr_notice("%s: attempt to write non page aligned data\n",
__func__);
return -EINVAL;