diff options
author | Kamal Dasu | 2019-05-01 15:22:14 -0400 |
---|---|---|
committer | Miquel Raynal | 2019-06-27 20:05:24 +0200 |
commit | 917cc5945f18fc9464d597b4c1bb50ac745d78b6 (patch) | |
tree | 1e5b9c02fc64a4491d90c73e824b54e5cd3cbbc7 /drivers/mtd | |
parent | 855eff216a97afa4a2233b792cb3c812b5ebd876 (diff) |
mtd: rawnand: brcmnand: Fix BCH ECC layout for large page NAND parts
The way oobregion->offset is derived for large page NAND parts is
wrong, fixes it.
Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 873527753f52..f368d1cb89f4 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -931,7 +931,7 @@ static int brcmnand_bch_ooblayout_ecc(struct mtd_info *mtd, int section, if (section >= sectors) return -ERANGE; - oobregion->offset = (section * (sas + 1)) - chip->ecc.bytes; + oobregion->offset = ((section + 1) * sas) - chip->ecc.bytes; oobregion->length = chip->ecc.bytes; return 0; |