Commit 917cc594 authored by Kamal Dasu's avatar Kamal Dasu Committed by Miquel Raynal
Browse files

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: ef5eeea6 ("mtd: nand: brcm: switch to mtd_ooblayout_ops")
Signed-off-by: default avatarKamal Dasu <kdasu.kdev@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 855eff21
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;