diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2012-04-24 04:05:22 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-14 00:03:31 -0400 |
commit | 4b6f05e14df163e319bc85ca6e35d2720a91207d (patch) | |
tree | 520a02f7e4a8b49cc66477206b0a4f79b36f1318 /drivers/mtd | |
parent | 377873600aea55d105c8e9ce14be4ca7bfdf362a (diff) |
mtd: mxc_nand: fix several sparse warnings about incorrect address space
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 1041bb134628..ec5ba8bac73e 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -181,8 +181,8 @@ struct mxc_nand_host { | |||
181 | struct nand_chip nand; | 181 | struct nand_chip nand; |
182 | struct device *dev; | 182 | struct device *dev; |
183 | 183 | ||
184 | void *spare0; | 184 | void __iomem *spare0; |
185 | void *main_area0; | 185 | void __iomem *main_area0; |
186 | 186 | ||
187 | void __iomem *base; | 187 | void __iomem *base; |
188 | void __iomem *regs; | 188 | void __iomem *regs; |
@@ -519,7 +519,7 @@ static void send_read_id_v3(struct mxc_nand_host *host) | |||
519 | 519 | ||
520 | wait_op_done(host, true); | 520 | wait_op_done(host, true); |
521 | 521 | ||
522 | memcpy(host->data_buf, host->main_area0, 16); | 522 | memcpy_fromio(host->data_buf, host->main_area0, 16); |
523 | } | 523 | } |
524 | 524 | ||
525 | /* Request the NANDFC to perform a read of the NAND device ID. */ | 525 | /* Request the NANDFC to perform a read of the NAND device ID. */ |
@@ -535,7 +535,7 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host) | |||
535 | /* Wait for operation to complete */ | 535 | /* Wait for operation to complete */ |
536 | wait_op_done(host, true); | 536 | wait_op_done(host, true); |
537 | 537 | ||
538 | memcpy(host->data_buf, host->main_area0, 16); | 538 | memcpy_fromio(host->data_buf, host->main_area0, 16); |
539 | 539 | ||
540 | if (this->options & NAND_BUSWIDTH_16) { | 540 | if (this->options & NAND_BUSWIDTH_16) { |
541 | /* compress the ID info */ | 541 | /* compress the ID info */ |
@@ -790,23 +790,23 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom) | |||
790 | u16 i, j; | 790 | u16 i, j; |
791 | u16 n = mtd->writesize >> 9; | 791 | u16 n = mtd->writesize >> 9; |
792 | u8 *d = host->data_buf + mtd->writesize; | 792 | u8 *d = host->data_buf + mtd->writesize; |
793 | u8 *s = host->spare0; | 793 | u8 __iomem *s = host->spare0; |
794 | u16 t = host->devtype_data->spare_len; | 794 | u16 t = host->devtype_data->spare_len; |
795 | 795 | ||
796 | j = (mtd->oobsize / n >> 1) << 1; | 796 | j = (mtd->oobsize / n >> 1) << 1; |
797 | 797 | ||
798 | if (bfrom) { | 798 | if (bfrom) { |
799 | for (i = 0; i < n - 1; i++) | 799 | for (i = 0; i < n - 1; i++) |
800 | memcpy(d + i * j, s + i * t, j); | 800 | memcpy_fromio(d + i * j, s + i * t, j); |
801 | 801 | ||
802 | /* the last section */ | 802 | /* the last section */ |
803 | memcpy(d + i * j, s + i * t, mtd->oobsize - i * j); | 803 | memcpy_fromio(d + i * j, s + i * t, mtd->oobsize - i * j); |
804 | } else { | 804 | } else { |
805 | for (i = 0; i < n - 1; i++) | 805 | for (i = 0; i < n - 1; i++) |
806 | memcpy(&s[i * t], &d[i * j], j); | 806 | memcpy_toio(&s[i * t], &d[i * j], j); |
807 | 807 | ||
808 | /* the last section */ | 808 | /* the last section */ |
809 | memcpy(&s[i * t], &d[i * j], mtd->oobsize - i * j); | 809 | memcpy_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j); |
810 | } | 810 | } |
811 | } | 811 | } |
812 | 812 | ||
@@ -1070,7 +1070,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
1070 | 1070 | ||
1071 | host->devtype_data->send_page(mtd, NFC_OUTPUT); | 1071 | host->devtype_data->send_page(mtd, NFC_OUTPUT); |
1072 | 1072 | ||
1073 | memcpy(host->data_buf, host->main_area0, mtd->writesize); | 1073 | memcpy_fromio(host->data_buf, host->main_area0, mtd->writesize); |
1074 | copy_spare(mtd, true); | 1074 | copy_spare(mtd, true); |
1075 | break; | 1075 | break; |
1076 | 1076 | ||
@@ -1086,7 +1086,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
1086 | break; | 1086 | break; |
1087 | 1087 | ||
1088 | case NAND_CMD_PAGEPROG: | 1088 | case NAND_CMD_PAGEPROG: |
1089 | memcpy(host->main_area0, host->data_buf, mtd->writesize); | 1089 | memcpy_toio(host->main_area0, host->data_buf, mtd->writesize); |
1090 | copy_spare(mtd, false); | 1090 | copy_spare(mtd, false); |
1091 | host->devtype_data->send_page(mtd, NFC_INPUT); | 1091 | host->devtype_data->send_page(mtd, NFC_INPUT); |
1092 | host->devtype_data->send_cmd(host, command, true); | 1092 | host->devtype_data->send_cmd(host, command, true); |