aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/fsl_ifc_nand.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/fsl_ifc_nand.c')
-rw-r--r--drivers/mtd/nand/fsl_ifc_nand.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 1f71b545062..e92d223e5e1 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -627,46 +627,6 @@ static void fsl_ifc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
627} 627}
628 628
629/* 629/*
630 * Verify buffer against the IFC Controller Data Buffer
631 */
632static int fsl_ifc_verify_buf(struct mtd_info *mtd,
633 const u_char *buf, int len)
634{
635 struct nand_chip *chip = mtd->priv;
636 struct fsl_ifc_mtd *priv = chip->priv;
637 struct fsl_ifc_ctrl *ctrl = priv->ctrl;
638 struct fsl_ifc_nand_ctrl *nctrl = ifc_nand_ctrl;
639 int i;
640
641 if (len < 0) {
642 dev_err(priv->dev, "%s: write_buf of %d bytes", __func__, len);
643 return -EINVAL;
644 }
645
646 if ((unsigned int)len > nctrl->read_bytes - nctrl->index) {
647 dev_err(priv->dev,
648 "%s: beyond end of buffer (%d requested, %u available)\n",
649 __func__, len, nctrl->read_bytes - nctrl->index);
650
651 nctrl->index = nctrl->read_bytes;
652 return -EINVAL;
653 }
654
655 for (i = 0; i < len; i++)
656 if (in_8(&nctrl->addr[nctrl->index + i]) != buf[i])
657 break;
658
659 nctrl->index += len;
660
661 if (i != len)
662 return -EIO;
663 if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
664 return -EIO;
665
666 return 0;
667}
668
669/*
670 * This function is called after Program and Erase Operations to 630 * This function is called after Program and Erase Operations to
671 * check for success or failure. 631 * check for success or failure.
672 */ 632 */
@@ -796,7 +756,6 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
796 756
797 chip->write_buf = fsl_ifc_write_buf; 757 chip->write_buf = fsl_ifc_write_buf;
798 chip->read_buf = fsl_ifc_read_buf; 758 chip->read_buf = fsl_ifc_read_buf;
799 chip->verify_buf = fsl_ifc_verify_buf;
800 chip->select_chip = fsl_ifc_select_chip; 759 chip->select_chip = fsl_ifc_select_chip;
801 chip->cmdfunc = fsl_ifc_cmdfunc; 760 chip->cmdfunc = fsl_ifc_cmdfunc;
802 chip->waitfunc = fsl_ifc_wait; 761 chip->waitfunc = fsl_ifc_wait;