From: Sascha Hauer <s.hauer@pengutronix.de>
To: linux-mtd@lists.infradead.org
Cc: Sam Lefebvre <sam.lefebvre@essensium.com>,
Boris Brezillon <bbrezillon@kernel.org>,
Richard Weinberger <richard@nod.at>,
Sascha Hauer <s.hauer@pengutronix.de>,
kernel@pengutronix.de, Miquel Raynal <miquel.raynal@bootlin.com>,
Han Xu <han.xu@nxp.com>
Subject: [PATCH 07/10] mtd: rawnand: gpmi: remove unused parameters
Date: Fri, 5 Apr 2019 12:07:37 +0200 [thread overview]
Message-ID: <20190405100740.5074-8-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20190405100740.5074-1-s.hauer@pengutronix.de>
gpmi_ecc_read_page_data uses the page parameter only for a debug printf,
so we can drop the parameter and the debug printf. Moving the oob
delivery from gpmi_ecc_read_page_data to gpmi_ecc_read_page makes the
oob_required parameter unnecessary aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 34 ++++++++++++----------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 6736d76fa1fb..c1d2e6d12e61 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -1852,9 +1852,7 @@ static void block_mark_swapping(struct gpmi_nand_data *this,
p[1] = (p[1] & mask) | (from_oob >> (8 - bit));
}
-static int gpmi_ecc_read_page_data(struct nand_chip *chip,
- uint8_t *buf, int oob_required,
- int page)
+static int gpmi_ecc_read_page_data(struct nand_chip *chip, uint8_t *buf)
{
struct gpmi_nand_data *this = nand_get_controller_data(chip);
struct bch_geometry *nfc_geo = &this->bch_geometry;
@@ -1866,8 +1864,6 @@ static int gpmi_ecc_read_page_data(struct nand_chip *chip,
int ret;
bool direct = false;
- dev_dbg(this->dev, "page number is : %d\n", page);
-
payload_phys = this->payload_phys;
if (virt_addr_valid(buf)) {
@@ -1982,6 +1978,22 @@ static int gpmi_ecc_read_page_data(struct nand_chip *chip,
/* handle the block mark swapping */
block_mark_swapping(this, buf, this->auxiliary_virt);
+ return max_bitflips;
+}
+
+static int gpmi_ecc_read_page(struct nand_chip *chip, uint8_t *buf,
+ int oob_required, int page)
+{
+ struct gpmi_nand_data *this = nand_get_controller_data(chip);
+ struct mtd_info *mtd = nand_to_mtd(chip);
+ int ret;
+
+ nand_read_page_op(chip, page, 0, NULL, 0);
+
+ ret = gpmi_ecc_read_page_data(chip, buf);
+ if (ret < 0)
+ return ret;
+
if (oob_required) {
/*
* It's time to deliver the OOB bytes. See gpmi_ecc_read_oob()
@@ -1997,15 +2009,7 @@ static int gpmi_ecc_read_page_data(struct nand_chip *chip,
chip->oob_poi[0] = ((uint8_t *)this->auxiliary_virt)[0];
}
- return max_bitflips;
-}
-
-static int gpmi_ecc_read_page(struct nand_chip *chip, uint8_t *buf,
- int oob_required, int page)
-{
- nand_read_page_op(chip, page, 0, NULL, 0);
-
- return gpmi_ecc_read_page_data(chip, buf, oob_required, page);
+ return ret;
}
/* Fake a virtual small page for the subpage read */
@@ -2086,7 +2090,7 @@ static int gpmi_ecc_read_subpage(struct nand_chip *chip, uint32_t offs,
/* Read the subpage now */
this->swap_block_mark = false;
- max_bitflips = gpmi_ecc_read_page_data(chip, buf, 0, page);
+ max_bitflips = gpmi_ecc_read_page_data(chip, buf);
/* Restore */
writel(r1_old, bch_regs + HW_BCH_FLASH0LAYOUT0);
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-04-05 10:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-05 10:07 [PATCH 00/10] Implement exec_op for GPMI nand driver Sascha Hauer
2019-04-05 10:07 ` [PATCH 01/10] mtd: rawnand: export nand operation tracer Sascha Hauer
2019-04-05 10:07 ` [PATCH 02/10] mtd: rawnand: fsmc: Use nand_op_trace for operation tracing Sascha Hauer
2019-04-05 10:07 ` [PATCH 03/10] mtd: rawnand: gpmi: move all driver code into single file Sascha Hauer
2019-04-05 10:07 ` [PATCH 04/10] mtd: rawnand: gpmi: remove unused variable Sascha Hauer
2019-04-05 10:07 ` [PATCH 05/10] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
2019-04-05 10:07 ` [PATCH 06/10] mtd: rawnand: gpmi: read buf in nand_read_page_op Sascha Hauer
2019-04-05 10:07 ` Sascha Hauer [this message]
2019-04-05 10:07 ` [PATCH 08/10] mtd: rawnand: gpmi: Drop unnecessary restoring of previous chipselection Sascha Hauer
2019-04-05 10:07 ` [PATCH 09/10] mtd: rawnand: gpmi: use runtime PM to manage clocks Sascha Hauer
2019-04-05 10:23 ` Lucas Stach
2019-04-05 10:07 ` [PATCH 10/10] mtd: rawnand: gpmi: Implement exec_op Sascha Hauer
2019-04-05 14:10 ` Sascha Hauer
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=20190405100740.5074-8-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=bbrezillon@kernel.org \
--cc=han.xu@nxp.com \
--cc=kernel@pengutronix.de \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=sam.lefebvre@essensium.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).