summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/stmicro.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/stmicro.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/stmicro.c')
-rw-r--r--drivers/mtd/spi/stmicro.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index 494005c..7ef690d 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -134,26 +134,6 @@ static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = {
},
};
-static int stmicro_read_fast(struct spi_flash *flash,
- u32 offset, size_t len, void *buf)
-{
- struct stmicro_spi_flash *stm = to_stmicro_spi_flash(flash);
- unsigned long page_addr;
- unsigned long page_size;
- u8 cmd[5];
-
- page_size = stm->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 stmicro_write(struct spi_flash *flash,
u32 offset, size_t len, const void *buf)
{
@@ -268,7 +248,7 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
stm->flash.write = stmicro_write;
stm->flash.erase = stmicro_erase;
- stm->flash.read = stmicro_read_fast;
+ stm->flash.read = spi_flash_cmd_read_fast;
stm->flash.size = params->page_size * params->pages_per_sector
* params->nr_sectors;