[RFC PATCH 2/3] mtd: nand: export nand_wait so that NAND controller driver can use it

Boris Brezillon boris.brezillon at free-electrons.com
Sat Feb 14 05:32:37 PST 2015


Export this function for NAND controller that which to use this default
implementation as their waitfunc method.

Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/nand_base.c | 3 ++-
 include/linux/mtd/nand.h     | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index e36ec5e..63bf2ba 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -872,7 +872,7 @@ static void panic_nand_wait(struct mtd_info *mtd, struct nand_chip *chip,
  * take up to 400ms and program up to 20ms according to general NAND and
  * SmartMedia specs.
  */
-static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
+int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
 {
 
 	int status, state = chip->state;
@@ -910,6 +910,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
 	WARN_ON(!(status & NAND_STATUS_READY));
 	return status;
 }
+EXPORT_SYMBOL_GPL(nand_wait);
 
 /**
  * __nand_unlock - [REPLACEABLE] unlocks specified locked blocks
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 6c0aadc..30f8aa1 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -26,6 +26,8 @@
 
 struct mtd_info;
 struct nand_flash_dev;
+struct nand_chip;
+
 /* Scan and identify a NAND device */
 extern int nand_scan(struct mtd_info *mtd, int max_chips);
 /*
@@ -42,6 +44,9 @@ extern void nand_release(struct mtd_info *mtd);
 /* Internal helper for board drivers which need to override command function */
 extern void nand_wait_ready(struct mtd_info *mtd);
 
+/* Internal helper for drivers which rely on the default nand_wait func */
+int nand_wait(struct mtd_info *mtd, struct nand_chip *chip);
+
 /* locks all blocks present in the device */
 extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
 
-- 
1.9.1




More information about the linux-mtd mailing list