Commit 7725cc85 authored by Brian Norris's avatar Brian Norris Committed by David Woodhouse

mtd: gpmi-nand: utilize oob_requested parameter

Don't read OOB if the caller didn't request it.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Acked-by: default avatarHuang Shijie <b32955@freescale.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent a6976cdf
...@@ -908,14 +908,16 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -908,14 +908,16 @@ 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 * It's time to deliver the OOB bytes. See gpmi_ecc_read_oob()
* details about our policy for delivering the OOB. * for details about our policy for delivering the OOB.
* *
* We fill the caller's buffer with set bits, and then copy the block * We fill the caller's buffer with set bits, and then copy the
* mark to th caller's buffer. Note that, if block mark swapping was * block mark to th caller's buffer. Note that, if block mark
* necessary, it has already been done, so we can rely on the first * swapping was necessary, it has already been done, so we can
* byte of the auxiliary buffer to contain the block mark. * rely on the first byte of the auxiliary buffer to contain
* the block mark.
*/ */
memset(chip->oob_poi, ~0, mtd->oobsize); memset(chip->oob_poi, ~0, mtd->oobsize);
chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0];
...@@ -924,6 +926,7 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -924,6 +926,7 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment