summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/stmicro.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-04-02 12:51:28 -0400
committerMike Frysinger <vapier@gentoo.org>2009-04-02 12:51:28 -0400
commitd9596ffbdc79cea285010b67dd20a4618303f624 (patch)
tree7ff278dd3468fb85ba484cc641c6c75ac00b7584 /drivers/mtd/spi/stmicro.c
parent1abe365ffcfc29c061e8fd8b45551be5ad1428dd (diff)
sf: stmicro: dont send 4 bytes when reading status register
I can't find anywhere in the datasheet that says the status register needs 3 dummy bytes sent to it before being able to read back the first real result. Tests on a Blackfin board show that after writing the opcode, the status register starts coming back immediately. So only write out the read status register opcode before polling the result. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Jason McMullan <mcmullan@netapp.com> CC: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Diffstat (limited to 'drivers/mtd/spi/stmicro.c')
-rw-r--r--drivers/mtd/spi/stmicro.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index b43e9f453..9b910c13f 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -133,12 +133,12 @@ static int stmicro_wait_ready(struct spi_flash *flash, unsigned long timeout)
struct spi_slave *spi = flash->spi;
unsigned long timebase;
int ret;
+ u8 cmd = CMD_M25PXX_RDSR;
u8 status;
- u8 cmd[4] = { CMD_M25PXX_RDSR, 0xff, 0xff, 0xff };
- ret = spi_xfer(spi, 32, &cmd[0], NULL, SPI_XFER_BEGIN);
+ ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
if (ret) {
- debug("SF: Failed to send command %02x: %d\n", cmd[0], ret);
+ debug("SF: Failed to send command %02x: %d\n", cmd, ret);
return ret;
}