mtd: rawnand: brcmnand: fix bch ecc layout for large page nand
PATCH v2 1/1 mtd: rawnand: brcmnand: fix bch ecc layout for large page nand
The oobregion->offset for large page nand parts was wrong, change fixes this error in calculation.
Fixes ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")
Signed-off-by Kamal Dasu <[email protected]>
--- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/brcmnand/brcmnand.c +1 -1
@@ -939,7 +939,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 ;
Signature · 1 line
1.9.0.138.g2de3478
Quoted 5 lines · Kamal Dasu
The
oobregion->offsetfor large page nand parts was wrong, change fixes this error in calculation.Fixes ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")Signed-off-by Kamal Dasu <[email protected]>
Reviewed-by Florian Fainelli <[email protected]>
Signature · 1 line
Florian
Quoted 6 lines · Kamal Dasu
The
oobregion->offsetfor large page nand parts was wrong, change fixes this error in calculation.Fixes ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")Signed-off-by Kamal Dasu <[email protected]>Reviewed-by Florian Fainelli <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel