aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorAaron Sierra <asierra@xes-inc.com>2014-04-07 12:58:12 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-05-20 20:36:25 -0400
commit4454406e378722d09431aca194103aa3075c6468 (patch)
tree948788f5d909efdf88b011500ffd68d5688ffff3 /drivers/mtd/nand
parent555b8d1259a4d384690c2f2a62e2d84d2a536ed3 (diff)
mtd: fsl_ifc_nand: Use void type for IFC buffer
The IFC buffer is accessed via 8-bit and 16-bit accessors. Changing the 'addr' member of 'struct fsl_ifc_nand_ctrl' from 'u8 __iomem *' to 'void __iomem *' eliminates the need for explicit casts when the 16-bit accessors are used. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/fsl_ifc_nand.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index cb45d2f8e208..8ed0ee1cfee1 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -56,7 +56,7 @@ struct fsl_ifc_nand_ctrl {
56 struct nand_hw_control controller; 56 struct nand_hw_control controller;
57 struct fsl_ifc_mtd *chips[FSL_IFC_BANK_COUNT]; 57 struct fsl_ifc_mtd *chips[FSL_IFC_BANK_COUNT];
58 58
59 u8 __iomem *addr; /* Address of assigned IFC buffer */ 59 void __iomem *addr; /* Address of assigned IFC buffer */
60 unsigned int page; /* Last page written to / read from */ 60 unsigned int page; /* Last page written to / read from */
61 unsigned int read_bytes;/* Number of bytes read during command */ 61 unsigned int read_bytes;/* Number of bytes read during command */
62 unsigned int column; /* Saved column from SEQIN */ 62 unsigned int column; /* Saved column from SEQIN */
@@ -636,7 +636,7 @@ static void fsl_ifc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
636 len = bufsize - ifc_nand_ctrl->index; 636 len = bufsize - ifc_nand_ctrl->index;
637 } 637 }
638 638
639 memcpy_toio(&ifc_nand_ctrl->addr[ifc_nand_ctrl->index], buf, len); 639 memcpy_toio(ifc_nand_ctrl->addr + ifc_nand_ctrl->index, buf, len);
640 ifc_nand_ctrl->index += len; 640 ifc_nand_ctrl->index += len;
641} 641}
642 642
@@ -648,13 +648,16 @@ static uint8_t fsl_ifc_read_byte(struct mtd_info *mtd)
648{ 648{
649 struct nand_chip *chip = mtd->priv; 649 struct nand_chip *chip = mtd->priv;
650 struct fsl_ifc_mtd *priv = chip->priv; 650 struct fsl_ifc_mtd *priv = chip->priv;
651 unsigned int offset;
651 652
652 /* 653 /*
653 * If there are still bytes in the IFC buffer, then use the 654 * If there are still bytes in the IFC buffer, then use the
654 * next byte. 655 * next byte.
655 */ 656 */
656 if (ifc_nand_ctrl->index < ifc_nand_ctrl->read_bytes) 657 if (ifc_nand_ctrl->index < ifc_nand_ctrl->read_bytes) {
657 return in_8(&ifc_nand_ctrl->addr[ifc_nand_ctrl->index++]); 658 offset = ifc_nand_ctrl->index++;
659 return in_8(ifc_nand_ctrl->addr + offset);
660 }
658 661
659 dev_err(priv->dev, "%s: beyond end of buffer\n", __func__); 662 dev_err(priv->dev, "%s: beyond end of buffer\n", __func__);
660 return ERR_BYTE; 663 return ERR_BYTE;
@@ -675,8 +678,7 @@ static uint8_t fsl_ifc_read_byte16(struct mtd_info *mtd)
675 * next byte. 678 * next byte.
676 */ 679 */
677 if (ifc_nand_ctrl->index < ifc_nand_ctrl->read_bytes) { 680 if (ifc_nand_ctrl->index < ifc_nand_ctrl->read_bytes) {
678 data = in_be16((uint16_t __iomem *)&ifc_nand_ctrl-> 681 data = in_be16(ifc_nand_ctrl->addr + ifc_nand_ctrl->index);
679 addr[ifc_nand_ctrl->index]);
680 ifc_nand_ctrl->index += 2; 682 ifc_nand_ctrl->index += 2;
681 return (uint8_t) data; 683 return (uint8_t) data;
682 } 684 }
@@ -701,7 +703,7 @@ static void fsl_ifc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
701 703
702 avail = min((unsigned int)len, 704 avail = min((unsigned int)len,
703 ifc_nand_ctrl->read_bytes - ifc_nand_ctrl->index); 705 ifc_nand_ctrl->read_bytes - ifc_nand_ctrl->index);
704 memcpy_fromio(buf, &ifc_nand_ctrl->addr[ifc_nand_ctrl->index], avail); 706 memcpy_fromio(buf, ifc_nand_ctrl->addr + ifc_nand_ctrl->index, avail);
705 ifc_nand_ctrl->index += avail; 707 ifc_nand_ctrl->index += avail;
706 708
707 if (len > avail) 709 if (len > avail)