From a4c3b40b33e41563077ea9ccbae7cac9d26ca38f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 10 Jan 2011 02:20:14 -0500 Subject: sf: unify read functions Signed-off-by: Mike Frysinger --- drivers/mtd/spi/spansion.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'drivers/mtd/spi/spansion.c') 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 const struct spansion_spi_flash_params spansion_spi_flash_table[] = { }, }; -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 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode) 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; -- cgit v1.1