aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpmi-nand
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2012-05-02 13:15:02 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-05-14 00:21:52 -0400
commit7725cc85932bd02dd12c23108e0ef748c551ccba (patch)
treebfa46669f69bb9c0f198ab65a8470de4d96decb5 /drivers/mtd/nand/gpmi-nand
parenta6976cdfe69756436ed8c22b7a03e47a7efe36fb (diff)
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>
Diffstat (limited to 'drivers/mtd/nand/gpmi-nand')
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index d85a2c1fad5..7e8a035d444 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -908,22 +908,25 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
908 mtd->ecc_stats.corrected += corrected; 908 mtd->ecc_stats.corrected += corrected;
909 } 909 }
910 910
911 /* 911 if (oob_required) {
912 * It's time to deliver the OOB bytes. See gpmi_ecc_read_oob() for 912 /*
913 * details about our policy for delivering the OOB. 913 * It's time to deliver the OOB bytes. See gpmi_ecc_read_oob()
914 * 914 * for details about our policy for delivering the OOB.
915 * We fill the caller's buffer with set bits, and then copy the block 915 *
916 * mark to th caller's buffer. Note that, if block mark swapping was 916 * We fill the caller's buffer with set bits, and then copy the
917 * necessary, it has already been done, so we can rely on the first 917 * block mark to th caller's buffer. Note that, if block mark
918 * byte of the auxiliary buffer to contain the block mark. 918 * swapping was necessary, it has already been done, so we can
919 */ 919 * rely on the first byte of the auxiliary buffer to contain
920 memset(chip->oob_poi, ~0, mtd->oobsize); 920 * the block mark.
921 chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; 921 */
922 memset(chip->oob_poi, ~0, mtd->oobsize);
923 chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0];
922 924
923 read_page_swap_end(this, buf, mtd->writesize, 925 read_page_swap_end(this, buf, mtd->writesize,
924 this->payload_virt, this->payload_phys, 926 this->payload_virt, this->payload_phys,
925 nfc_geo->payload_size, 927 nfc_geo->payload_size,
926 payload_virt, payload_phys); 928 payload_virt, payload_phys);
929 }
927exit_nfc: 930exit_nfc:
928 return ret; 931 return ret;
929} 932}