mirror of https://gitee.com/openkylin/linux.git
mtd: gpmi-nand: utilize oob_requested parameter
Don't read OOB if the caller didn't request it. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
a6976cdfe6
commit
7725cc8593
|
@ -908,22 +908,25 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
|
||||||
mtd->ecc_stats.corrected += corrected;
|
mtd->ecc_stats.corrected += corrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (oob_required) {
|
||||||
* It's time to deliver the OOB bytes. See gpmi_ecc_read_oob() for
|
/*
|
||||||
* details about our policy for delivering the OOB.
|
* It's time to deliver the OOB bytes. See gpmi_ecc_read_oob()
|
||||||
*
|
* for details about our policy for delivering the OOB.
|
||||||
* We fill the caller's buffer with set bits, and then copy the block
|
*
|
||||||
* mark to th caller's buffer. Note that, if block mark swapping was
|
* We fill the caller's buffer with set bits, and then copy the
|
||||||
* necessary, it has already been done, so we can rely on the first
|
* block mark to th caller's buffer. Note that, if block mark
|
||||||
* byte of the auxiliary buffer to contain the block mark.
|
* swapping was necessary, it has already been done, so we can
|
||||||
*/
|
* rely on the first byte of the auxiliary buffer to contain
|
||||||
memset(chip->oob_poi, ~0, mtd->oobsize);
|
* the block mark.
|
||||||
chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0];
|
*/
|
||||||
|
memset(chip->oob_poi, ~0, mtd->oobsize);
|
||||||
|
chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0];
|
||||||
|
|
||||||
read_page_swap_end(this, buf, mtd->writesize,
|
read_page_swap_end(this, buf, mtd->writesize,
|
||||||
this->payload_virt, this->payload_phys,
|
this->payload_virt, this->payload_phys,
|
||||||
nfc_geo->payload_size,
|
nfc_geo->payload_size,
|
||||||
payload_virt, payload_phys);
|
payload_virt, payload_phys);
|
||||||
|
}
|
||||||
exit_nfc:
|
exit_nfc:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue