diff options
| author | Benoît Thébaudeau <benoit.thebaudeau@advansee.com> | 2012-11-05 10:16:15 +0000 | 
|---|---|---|
| committer | Scott Wood <scottwood@freescale.com> | 2012-11-26 15:41:28 -0600 | 
| commit | 8156f732ee49fc4d91aef1ce09fb6679b3a23c0c (patch) | |
| tree | e22891e91d56005029071231f64491ba4d2ba760 | |
| parent | bd74280d6218c7bd09021038c92aa07e8a118cc1 (diff) | |
| download | olio-uboot-2014.01-8156f732ee49fc4d91aef1ce09fb6679b3a23c0c.tar.xz olio-uboot-2014.01-8156f732ee49fc4d91aef1ce09fb6679b3a23c0c.zip | |
nand: Fix nand_erase_opts() offset check
NAND Flash is erased by blocks, not by pages.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
| -rw-r--r-- | drivers/mtd/nand/nand_util.c | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c index 3f111038f..285568316 100644 --- a/drivers/mtd/nand/nand_util.c +++ b/drivers/mtd/nand/nand_util.c @@ -80,8 +80,8 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)  	struct mtd_oob_ops oob_opts;  	struct nand_chip *chip = meminfo->priv; -	if ((opts->offset & (meminfo->writesize - 1)) != 0) { -		printf("Attempt to erase non page-aligned data\n"); +	if ((opts->offset & (meminfo->erasesize - 1)) != 0) { +		printf("Attempt to erase non block-aligned data\n");  		return -1;  	} |