diff options
author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-09-07 00:38:37 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-10-03 11:12:25 +0200 |
commit | 8395b753d7cad2beb03d374621cc8851f1cb4e01 (patch) | |
tree | 7f54a3d0838bc6fcd0c22c20bfde24dccf037384 /drivers/mtd/nand/raw/nand_base.c | |
parent | bf6065c6c08fa3ed7bdf8d28b8062ce8e58c1543 (diff) | |
download | lwn-8395b753d7cad2beb03d374621cc8851f1cb4e01.tar.gz lwn-8395b753d7cad2beb03d374621cc8851f1cb4e01.zip |
mtd: rawnand: Deprecate ->dev_ready() and ->waitfunc()
Those hooks have been replaced by ->exec_op(). Move them to the
nand_legacy struct.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/raw/nand_base.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index f3d6cd52f7eb..30b55a4677f9 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -604,7 +604,7 @@ static void panic_nand_wait_ready(struct mtd_info *mtd, unsigned long timeo) /* Wait for the device to get ready */ for (i = 0; i < timeo; i++) { - if (chip->dev_ready(chip)) + if (chip->legacy.dev_ready(chip)) break; touch_softlockup_watchdog(); mdelay(1); @@ -628,12 +628,12 @@ void nand_wait_ready(struct nand_chip *chip) /* Wait until command is processed or timeout occurs */ timeo = jiffies + msecs_to_jiffies(timeo); do { - if (chip->dev_ready(chip)) + if (chip->legacy.dev_ready(chip)) return; cond_resched(); } while (time_before(jiffies, timeo)); - if (!chip->dev_ready(chip)) + if (!chip->legacy.dev_ready(chip)) pr_warn_ratelimited("timeout while waiting for chip to become ready\n"); } EXPORT_SYMBOL_GPL(nand_wait_ready); @@ -804,7 +804,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command, return; case NAND_CMD_RESET: - if (chip->dev_ready) + if (chip->legacy.dev_ready) break; udelay(chip->chip_delay); chip->legacy.cmd_ctrl(chip, NAND_CMD_STATUS, @@ -831,7 +831,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command, * If we don't have access to the busy pin, we apply the given * command delay */ - if (!chip->dev_ready) { + if (!chip->legacy.dev_ready) { udelay(chip->chip_delay); return; } @@ -941,7 +941,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command, return; case NAND_CMD_RESET: - if (chip->dev_ready) + if (chip->legacy.dev_ready) break; udelay(chip->chip_delay); chip->legacy.cmd_ctrl(chip, NAND_CMD_STATUS, @@ -983,7 +983,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command, * If we don't have access to the busy pin, we apply the given * command delay. */ - if (!chip->dev_ready) { + if (!chip->legacy.dev_ready) { udelay(chip->chip_delay); return; } @@ -1069,8 +1069,8 @@ static void panic_nand_wait(struct nand_chip *chip, unsigned long timeo) { int i; for (i = 0; i < timeo; i++) { - if (chip->dev_ready) { - if (chip->dev_ready(chip)) + if (chip->legacy.dev_ready) { + if (chip->legacy.dev_ready(chip)) break; } else { int ret; @@ -1117,8 +1117,8 @@ static int nand_wait(struct nand_chip *chip) else { timeo = jiffies + msecs_to_jiffies(timeo); do { - if (chip->dev_ready) { - if (chip->dev_ready(chip)) + if (chip->legacy.dev_ready) { + if (chip->legacy.dev_ready(chip)) break; } else { ret = nand_read_data_op(chip, &status, @@ -1827,7 +1827,7 @@ int nand_prog_page_end_op(struct nand_chip *chip) return ret; } else { chip->legacy.cmdfunc(chip, NAND_CMD_PAGEPROG, -1, -1); - ret = chip->waitfunc(chip); + ret = chip->legacy.waitfunc(chip); if (ret < 0) return ret; @@ -1875,7 +1875,7 @@ int nand_prog_page_op(struct nand_chip *chip, unsigned int page, page); chip->legacy.write_buf(chip, buf, len); chip->legacy.cmdfunc(chip, NAND_CMD_PAGEPROG, -1, -1); - status = chip->waitfunc(chip); + status = chip->legacy.waitfunc(chip); } if (status & NAND_STATUS_FAIL) @@ -2106,7 +2106,7 @@ int nand_erase_op(struct nand_chip *chip, unsigned int eraseblock) chip->legacy.cmdfunc(chip, NAND_CMD_ERASE1, -1, page); chip->legacy.cmdfunc(chip, NAND_CMD_ERASE2, -1, -1); - ret = chip->waitfunc(chip); + ret = chip->legacy.waitfunc(chip); if (ret < 0) return ret; @@ -2157,7 +2157,7 @@ static int nand_set_features_op(struct nand_chip *chip, u8 feature, for (i = 0; i < ONFI_SUBFEATURE_PARAM_LEN; ++i) chip->legacy.write_byte(chip, params[i]); - ret = chip->waitfunc(chip); + ret = chip->legacy.waitfunc(chip); if (ret < 0) return ret; @@ -2222,7 +2222,7 @@ static int nand_wait_rdy_op(struct nand_chip *chip, unsigned int timeout_ms, } /* Apply delay or wait for ready/busy pin */ - if (!chip->dev_ready) + if (!chip->legacy.dev_ready) udelay(chip->chip_delay); else nand_wait_ready(chip); @@ -4927,8 +4927,8 @@ static void nand_set_defaults(struct nand_chip *chip) chip->legacy.cmdfunc = nand_command; /* check, if a user supplied wait function given */ - if (chip->waitfunc == NULL) - chip->waitfunc = nand_wait; + if (chip->legacy.waitfunc == NULL) + chip->legacy.waitfunc = nand_wait; if (!chip->select_chip) chip->select_chip = nand_select_chip; |