Revert "[MTD] m25p80.c code cleanup"
David Woodhouse [Mon, 20 Oct 2008 08:26:16 +0000 (09:26 +0100)]
This reverts commit 75d0ee2202b5740e94e913d8a52f91c6557c4c81.

Although it seems ObviouslyCorrectâ„¢, the spi_write() call uses DMA,
while spi_write_then_read() does not. Since our buffer is on the stack,
we must use the latter even though we don't actually want to read
anything back.

Pointed out by David Brownell <david-b@pacbell.net>

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

drivers/mtd/devices/m25p80.c

index 697a3a2..76a7675 100644 (file)
@@ -134,7 +134,7 @@ static inline int write_enable(struct m25p *flash)
 {
        u8      code = OPCODE_WREN;
 
-       return spi_write(flash->spi, &code, 1);
+       return spi_write_then_read(flash->spi, &code, 1, NULL, 0);
 }