sf: unify read functions
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index be4fc67..d54a5fa 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -133,30 +133,6 @@
},
};
-static int spansion_read_fast(struct spi_flash *flash,
- u32 offset, size_t len, void *buf)
-{
- struct spansion_spi_flash *spsn = to_spansion_spi_flash(flash);
- unsigned long page_addr;
- unsigned long page_size;
- u8 cmd[5];
-
- page_size = spsn->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;
-
- debug
- ("READ: 0x%x => cmd = { 0x%02x 0x%02x%02x%02x%02x } len = 0x%x\n",
- offset, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], len);
-
- return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
static int spansion_write(struct spi_flash *flash,
u32 offset, size_t len, const void *buf)
{
@@ -263,7 +239,7 @@
spsn->flash.write = spansion_write;
spsn->flash.erase = spansion_erase;
- spsn->flash.read = spansion_read_fast;
+ spsn->flash.read = spi_flash_cmd_read_fast;
spsn->flash.size = params->page_size * params->pages_per_sector
* params->nr_sectors;