summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/atmel.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/atmel.c
parente7b44eddbef88b1a922f8d82088ba236aad01caf (diff)
sf: unify read functions
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/mtd/spi/atmel.c')
-rw-r--r--drivers/mtd/spi/atmel.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c
index 7827b750f6..a9910b11b8 100644
--- a/drivers/mtd/spi/atmel.c
+++ b/drivers/mtd/spi/atmel.c
@@ -143,20 +143,6 @@ static void at45_build_address(struct atmel_spi_flash *asf, u8 *cmd, u32 offset)
cmd[2] = byte_addr;
}
-static int dataflash_read_fast_p2(struct spi_flash *flash,
- u32 offset, size_t len, void *buf)
-{
- u8 cmd[5];
-
- cmd[0] = CMD_READ_ARRAY_FAST;
- cmd[1] = offset >> 16;
- cmd[2] = offset >> 8;
- cmd[3] = offset;
- cmd[4] = 0x00;
-
- return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
-}
-
static int dataflash_read_fast_at45(struct spi_flash *flash,
u32 offset, size_t len, void *buf)
{
@@ -492,7 +478,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
asf->flash.erase = dataflash_erase_at45;
page_size += 1 << (params->l2_page_size - 5);
} else {
- asf->flash.read = dataflash_read_fast_p2;
+ asf->flash.read = spi_flash_cmd_read_fast;
asf->flash.write = dataflash_write_p2;
asf->flash.erase = dataflash_erase_p2;
}
@@ -501,7 +487,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
case DF_FAMILY_AT26F:
case DF_FAMILY_AT26DF:
- asf->flash.read = dataflash_read_fast_p2;
+ asf->flash.read = spi_flash_cmd_read_fast;
break;
default: