Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a1a6272 authored by David Woodhouse's avatar David Woodhouse
Browse files

Revert "[MTD] m25p80.c code cleanup"



This reverts commit 75d0ee22.

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: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 7d28e0d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}