@@ -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
@@ -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);
Export this function for NAND controller that which to use this default implementation as their waitfunc method. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> --- drivers/mtd/nand/nand_base.c | 3 ++- include/linux/mtd/nand.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)