Skip to content
Snippets Groups Projects
Commit 8156f732 authored by Benoît Thébaudeau's avatar Benoît Thébaudeau Committed by Scott Wood
Browse files

nand: Fix nand_erase_opts() offset check


NAND Flash is erased by blocks, not by pages.

Signed-off-by: default avatarBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
parent bd74280d
No related branches found
No related tags found
No related merge requests found
...@@ -80,8 +80,8 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts) ...@@ -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 mtd_oob_ops oob_opts;
struct nand_chip *chip = meminfo->priv; struct nand_chip *chip = meminfo->priv;
if ((opts->offset & (meminfo->writesize - 1)) != 0) { if ((opts->offset & (meminfo->erasesize - 1)) != 0) {
printf("Attempt to erase non page-aligned data\n"); printf("Attempt to erase non block-aligned data\n");
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment