diff options
author | Kamal Dasu <kdasu.kdev@gmail.com> | 2019-05-01 21:22:14 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2019-06-27 20:05:24 +0200 |
commit | 917cc5945f18fc9464d597b4c1bb50ac745d78b6 (patch) | |
tree | 1e5b9c02fc64a4491d90c73e824b54e5cd3cbbc7 /drivers/mtd | |
parent | mtd: onenand: Add support for 8Gb datasize onenand (diff) | |
download | linux-917cc5945f18fc9464d597b4c1bb50ac745d78b6.tar.xz linux-917cc5945f18fc9464d597b4c1bb50ac745d78b6.zip |
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; |