From: Fugang Duan <b38611@freescale.com>
To: <computersforpeace@gmail.com>, <han.xu@nxp.com>, <richard@nod.at>
Cc: <dwmw2@infradead.org>, <linux-mtd@lists.infradead.org>,
<fugang.duan@nxp.com>
Subject: [PATCH] mtd: nand: gpmi: remove duplicate 'nand-on-flash-bbt' property parse
Date: Tue, 5 Apr 2016 12:48:42 +0800 [thread overview]
Message-ID: <1459831722-2623-1-git-send-email-b38611@freescale.com> (raw)
Remove duplicate 'nand-on-flash-bbt' property parse in driver. In fact,
nand base driver has the common dts node parse in .nand_dt_init() like
nand_scan_ident()->nand_dt_init()->of_get_nand_on_flash_bbt().
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 8122c69..0486bf2 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1914,16 +1914,6 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
/* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
this->swap_block_mark = !GPMI_IS_MX23(this);
- if (of_get_nand_on_flash_bbt(this->dev->of_node)) {
- chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
-
- if (of_property_read_bool(this->dev->of_node,
- "fsl,no-blockmark-swap"))
- this->swap_block_mark = false;
- }
- dev_dbg(this->dev, "Blockmark swapping %sabled\n",
- this->swap_block_mark ? "en" : "dis");
-
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
@@ -1938,6 +1928,16 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (ret)
goto err_out;
+ if (chip->bbt_options & NAND_BBT_USE_FLASH) {
+ chip->bbt_options |= NAND_BBT_NO_OOB;
+
+ if (of_property_read_bool(this->dev->of_node,
+ "fsl,no-blockmark-swap"))
+ this->swap_block_mark = false;
+ }
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
ret = gpmi_init_last(this);
if (ret)
goto err_out;
--
1.9.1
next reply other threads:[~2016-04-05 4:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 4:48 Fugang Duan [this message]
2016-04-05 9:48 ` [PATCH] mtd: nand: gpmi: remove duplicate 'nand-on-flash-bbt' property parse Fugang Duan
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=1459831722-2623-1-git-send-email-b38611@freescale.com \
--to=b38611@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=fugang.duan@nxp.com \
--cc=han.xu@nxp.com \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/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