summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/macronix.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-01-10 02:20:14 -0500
committerWolfgang Denk <wd@denx.de>2011-04-11 21:00:55 +0200
commita4c3b40b33e41563077ea9ccbae7cac9d26ca38f (patch)
tree9f108ec5820f069a7c790c65aa1df6726f48c9e2 /drivers/mtd/spi/macronix.c
parente7b44eddbef88b1a922f8d82088ba236aad01caf (diff)
downloadu-boot-imx-a4c3b40b33e41563077ea9ccbae7cac9d26ca38f.zip
u-boot-imx-a4c3b40b33e41563077ea9ccbae7cac9d26ca38f.tar.gz
u-boot-imx-a4c3b40b33e41563077ea9ccbae7cac9d26ca38f.tar.bz2
sf: unify read functions
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/mtd/spi/macronix.c')
-rw-r--r--drivers/mtd/spi/macronix.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/mtd/spi/macronix.c b/drivers/mtd/spi/macronix.c
index 573e1db..4155d4d 100644
--- a/drivers/mtd/spi/macronix.c
+++ b/drivers/mtd/spi/macronix.c
@@ -112,26 +112,6 @@ static const struct macronix_spi_flash_params macronix_spi_flash_table[] = {
},
};
-static int macronix_read_fast(struct spi_flash *flash,
- u32 offset, size_t len, void *buf)
-{
- struct macronix_spi_flash *mcx = to_macronix_spi_flash(flash);
- unsigned long page_addr;
- unsigned long page_size;
- u8 cmd[5];
-
- page_size = mcx->params->page_size;
- page_addr = offset / page_size;
-
- cmd[0] = CMD_READ_ARRAY_FAST;
- cmd[1] = page_addr >> 8;
- cmd[2] = page_addr;
- cmd[3] = offset % page_size;
- cmd[4] = 0x00;
-
- return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
static int macronix_write(struct spi_flash *flash,
u32 offset, size_t len, const void *buf)
{
@@ -234,7 +214,7 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
mcx->flash.write = macronix_write;
mcx->flash.erase = macronix_erase;
- mcx->flash.read = macronix_read_fast;
+ mcx->flash.read = spi_flash_cmd_read_fast;
mcx->flash.size = params->page_size * params->pages_per_sector
* params->sectors_per_block * params->nr_blocks;