diff options
author | Scott Wood <scottwood@freescale.com> | 2010-07-30 16:11:41 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2010-10-11 15:09:23 -0500 |
commit | f9a5254111a6be2a39464f65a96f4fc2305e3c76 (patch) | |
tree | c03bcbaf8c60cc46544e5387aa6d5fb44a3e9bef /drivers/mtd/nand/nand_base.c | |
parent | bfc7bea6adc46e1db2f5a5e3464d7652ed67c864 (diff) | |
download | u-boot-imx-f9a5254111a6be2a39464f65a96f4fc2305e3c76.zip u-boot-imx-f9a5254111a6be2a39464f65a96f4fc2305e3c76.tar.gz u-boot-imx-f9a5254111a6be2a39464f65a96f4fc2305e3c76.tar.bz2 |
nand util: read/write: accept unaligned length
The underlying code in nand_base.c already supports non-page-aligned reads
and writes, but the block-skipping wrapper code did not.
With block skipping, an unaligned start address is not useful since you
really want to be starting at the beginning of a partition -- or at least
that's where you want to start checking for blocks to skip, but we don't
(yet) support that. So we still require the start address to be aligned.
An unaligned length, though, is useful for passing $filesize to the
read/write command, and handling it does not complicate block skipping.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 7d17846..276dbfd 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2001,13 +2001,6 @@ static 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)); |