]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
nand: Fix nand_erase_opts() offset check
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Mon, 5 Nov 2012 10:16:15 +0000 (10:16 +0000)
committerScott Wood <scottwood@freescale.com>
Mon, 26 Nov 2012 21:41:28 +0000 (15:41 -0600)
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>
drivers/mtd/nand/nand_util.c

index 3f111038f16dd8aeffbf570389e99c5e158900d8..285568316170cc8db2f5db74681d67b0bebc0717 100644 (file)
@@ -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;
        }