From: 黄涛 Date: Sat, 30 Jul 2011 14:30:42 +0000 (+0800) Subject: Revert "mtd: nand: Add naieve panic_write support for generic nand devices." X-Git-Tag: firefly_0821_release~9961 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=55a9ce2d623f2f23a29cfadc87fa23ee6ee3d840;p=firefly-linux-kernel-4.4.55.git Revert "mtd: nand: Add naieve panic_write support for generic nand devices." This reverts commit a431be40b097bb30ac0766b46364c041f99a9e11. --- diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 0d3e8b779715..363a3a5b09d5 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2681,44 +2681,6 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips) return 0; } -static void nand_panic_wait(struct mtd_info *mtd) -{ - struct nand_chip *chip = mtd->priv; - int i; - - if (chip->state != FL_READY) - for (i = 0; i < 40; i++) { - if (chip->dev_ready(mtd)) - break; - mdelay(10); - } - chip->state = FL_READY; -} - -static int nand_panic_write(struct mtd_info *mtd, loff_t to, size_t len, - size_t *retlen, const u_char *buf) -{ - struct nand_chip *chip = mtd->priv; - int ret; - - /* Do not allow reads past end of device */ - if ((to + len) > mtd->size) - return -EINVAL; - if (!len) - return 0; - - nand_panic_wait(mtd); - - chip->ops.len = len; - chip->ops.datbuf = (uint8_t *)buf; - chip->ops.oobbuf = NULL; - - ret = nand_do_write_ops(mtd, to, &chip->ops); - - *retlen = chip->ops.retlen; - return ret; -} - /** * nand_scan_tail - [NAND Interface] Scan for the NAND device @@ -2926,7 +2888,6 @@ int nand_scan_tail(struct mtd_info *mtd) mtd->write = nand_write; mtd->read_oob = nand_read_oob; mtd->write_oob = nand_write_oob; - mtd->panic_write = nand_panic_write; mtd->sync = nand_sync; mtd->lock = NULL; mtd->unlock = NULL;