Skip to content

Commit

Permalink
fixup! mtd: nand: core: use mtd_ooblayout_xxx() helpers where appropr…
Browse files Browse the repository at this point in the history
…iate
  • Loading branch information
Boris Brezillon committed Feb 26, 2016
1 parent 8277bba commit 51fcc44
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/mtd/nand/nand_base.c
Expand Up @@ -4292,6 +4292,17 @@ int nand_scan_tail(struct mtd_info *mtd)
mtd->ecc_strength = ecc->strength;
mtd->ecc_step_size = ecc->size;

/*
* Set the number of read / write steps for one page depending on ECC
* mode.
*/
ecc->steps = mtd->writesize / ecc->size;
if (ecc->steps * ecc->size != mtd->writesize) {
pr_warn("Invalid ECC parameters\n");
BUG();
}
ecc->total = ecc->steps * ecc->bytes;

/*
* The number of bytes available for a client to place data into
* the out of band area.
Expand All @@ -4307,17 +4318,6 @@ int nand_scan_tail(struct mtd_info *mtd)
pr_warn("WARNING: %s: the ECC used on your system is too weak compared to the one required by the NAND chip\n",
mtd->name);

/*
* Set the number of read / write steps for one page depending on ECC
* mode.
*/
ecc->steps = mtd->writesize / ecc->size;
if (ecc->steps * ecc->size != mtd->writesize) {
pr_warn("Invalid ECC parameters\n");
BUG();
}
ecc->total = ecc->steps * ecc->bytes;

/* Allow subpage writes up to ecc.steps. Not possible for MLC flash */
if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) {
switch (ecc->steps) {
Expand Down

0 comments on commit 51fcc44

Please sign in to comment.