Skip to content

Commit

Permalink
Revert "[MTD] m25p80.c code cleanup"
Browse files Browse the repository at this point in the history
This reverts commit 75d0ee2.

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>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Oct 20, 2008
1 parent 7d28e0d commit 8a1a627
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 8a1a627

Please sign in to comment.