Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ec47873 authored by Krishna Konda's avatar Krishna Konda
Browse files

mtd: msm_qpic_nand: fix oobavail value



The layout for msm nand targets specifies that "oobavail" parameter of
"struct mtd_info" is dependent on the page size of the device rather than
the spare size. Fix the condition that sets the "oobavail" value.

CRs-Fixed: 791500
Change-Id: I88f8a0d445245a683d19852598b5b86f90778af3
Signed-off-by: default avatarKrishna Konda <kkonda@codeaurora.org>
parent ed88427f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2532,12 +2532,12 @@ int msm_nand_scan(struct mtd_info *mtd)
		chip->cfg0_raw, chip->cfg1_raw, chip->ecc_buf_cfg,
		chip->ecc_bch_cfg, bad_block_byte);

	if (mtd->oobsize == 64) {
	if (mtd->writesize == 2048)
		mtd->oobavail = 16;
	} else if ((mtd->oobsize == 128) || (mtd->oobsize == 224)) {
	else if (mtd->writesize == 4096)
		mtd->oobavail = 32;
	} else {
		pr_err("Unsupported NAND oobsize: 0x%x\n", mtd->oobsize);
	else {
		pr_err("Unsupported NAND pagesize: 0x%x\n", mtd->writesize);
		err = -ENODEV;
		goto out;
	}