[PATCH 13/18] mtd: rawnand: gpmi: explicit delays are not needed
Sam Lefebvre
sam.lefebvre at essensium.com
Fri Apr 20 01:19:41 PDT 2018
From: "Arnout Vandecappelle (Essensium/Mind)" <arnout at mind.be>
gpmi-nand implements the dev_ready function, so explicit delays are not
needed for the RESET and READ0 commands. Therefore, the
gpmi_wait_status_ready() function and the includes it brings in are not
needed.
The RESET command just falls through to the nand_wait_ready() call.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 40 ------------------------------
1 file changed, 40 deletions(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index ccde6500f981..8531bc8d531d 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -25,7 +25,6 @@
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mtd/partitions.h>
-#include <linux/nmi.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include "gpmi-nand.h"
@@ -1093,25 +1092,6 @@ static int gpmi_ecc_read_page_data(struct nand_chip *chip,
return max_bitflips;
}
-static void gpmi_wait_status_ready(struct mtd_info *mtd, unsigned long timeo)
-{
- register struct nand_chip *chip = mtd_to_nand(mtd);
- int ret;
-
- timeo = jiffies + msecs_to_jiffies(timeo);
- do {
- u8 status;
-
- ret = nand_read_data_op(chip, &status, sizeof(status), true);
- if (ret)
- return;
-
- if (status & NAND_STATUS_READY)
- break;
- touch_softlockup_watchdog();
- } while (time_before(jiffies, timeo));
-};
-
/**
* gpmi_nand_command - Send command to NAND device
* @mtd: MTD device structure
@@ -1212,18 +1192,6 @@ static void gpmi_nand_command(struct mtd_info *mtd, unsigned int command,
}
break;
- case NAND_CMD_RESET:
- if (chip->dev_ready)
- break;
- udelay(chip->chip_delay);
- chip->cmd_ctrl(mtd, NAND_CMD_STATUS,
- NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
- chip->cmd_ctrl(mtd, NAND_CMD_NONE,
- NAND_NCE | NAND_CTRL_CHANGE);
- /* EZ-NAND can take upto 250ms as per ONFi v4.0 */
- gpmi_wait_status_ready(mtd, 250);
- return;
-
case NAND_CMD_RNDOUT:
if (is_lp) {
/* No ready / busy check necessary */
@@ -1254,14 +1222,6 @@ static void gpmi_nand_command(struct mtd_info *mtd, unsigned int command,
/* Read commands must wait */
break;
}
- /*
- * If we don't have access to the busy pin, we apply the given command
- * delay.
- */
- if (!chip->dev_ready) {
- udelay(chip->chip_delay);
- return;
- }
/*
* Apply this short delay always to ensure that we do wait tWB in
--
2.14.1
More information about the linux-mtd
mailing list