linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>
Cc: Bryan Wu <cooloney@kernel.org>, Mike Dunn <mikedunn@newsguy.com>,
	Mike Frysinger <vapier.adi@gmail.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Jamie Iles <jamie@jamieiles.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH v4 03/10] mtd: Blackfin NFC: utilize oob_required parameter
Date: Wed,  2 May 2012 10:14:57 -0700	[thread overview]
Message-ID: <1335978904-8005-4-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1335978904-8005-1-git-send-email-computersforpeace@gmail.com>

Don't read/write OOB if the caller doesn't require it.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/bf5xx_nand.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 3f1c185..8188416 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -561,7 +561,8 @@ static int bf5xx_nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip
 		uint8_t *buf, int oob_required, int page)
 {
 	bf5xx_nand_read_buf(mtd, buf, mtd->writesize);
-	bf5xx_nand_read_buf(mtd, chip->oob_poi, mtd->oobsize);
+	if (oob_required)
+		bf5xx_nand_read_buf(mtd, chip->oob_poi, mtd->oobsize);
 
 	return 0;
 }
@@ -570,7 +571,8 @@ static void bf5xx_nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *ch
 		const uint8_t *buf, int oob_required)
 {
 	bf5xx_nand_write_buf(mtd, buf, mtd->writesize);
-	bf5xx_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize);
+	if (oob_required)
+		bf5xx_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize);
 }
 
 /*
-- 
1.7.5.4.2.g519b1

  parent reply	other threads:[~2012-05-02 17:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 17:14 [PATCH v4 00/10] mtd: nand: rework nand_ecc_ctrl interface for OOB Brian Norris
2012-05-02 17:14 ` [PATCH v4 01/10] mtd: nand: add 'oob_required' argument to NAND {read, write}_page interfaces Brian Norris
2012-05-03 17:16   ` Mike Dunn
2012-05-03 17:43     ` Shmulik Ladkani
2012-05-03 22:34       ` Brian Norris
2012-05-04  7:58         ` Artem Bityutskiy
2012-05-02 17:14 ` [PATCH v4 02/10] mtd: nand: pass proper 'oob_required' parameter Brian Norris
2012-05-02 17:14 ` Brian Norris [this message]
2012-05-03  9:55   ` [PATCH v4 03/10] mtd: Blackfin NFC: utilize oob_required parameter Artem Bityutskiy
2012-05-02 17:14 ` [PATCH v4 04/10] mtd: cafe_nand: " Brian Norris
2012-05-02 17:14 ` [PATCH v4 05/10] mtd: denali: " Brian Norris
2012-05-02 17:15 ` [PATCH v4 06/10] mtd: eLBC NAND: " Brian Norris
2012-05-02 17:15 ` [PATCH v4 07/10] mtd: IFC " Brian Norris
2012-05-02 17:15 ` [PATCH v4 08/10] mtd: gpmi-nand: utilize oob_requested parameter Brian Norris
2012-05-02 17:15 ` [PATCH v4 09/10] mtd: nand: utilize oob_required parameter Brian Norris
2012-05-02 17:15 ` [PATCH v4 10/10] mtd: pxa3xx_nand: " Brian Norris
2012-05-03 10:00 ` [PATCH v4 00/10] mtd: nand: rework nand_ecc_ctrl interface for OOB Artem Bityutskiy
2012-05-03 17:11   ` Mike Dunn
2012-05-04  7:23     ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335978904-8005-4-git-send-email-computersforpeace@gmail.com \
    --to=computersforpeace@gmail.com \
    --cc=cooloney@kernel.org \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=jamie@jamieiles.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mikedunn@newsguy.com \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).