]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: spi-nor: Fix direction of the write_sr() transfer
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 4 Oct 2019 10:47:55 +0000 (10:47 +0000)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 4 Oct 2019 16:09:01 +0000 (18:09 +0200)
write_sr() sends data to the SPI memory, fix the direction.

Fixes: b35b9a10362d ("mtd: spi-nor: Move m25p80 code in spi-nor.c")
Reported-by: John Garry <john.garry@huawei.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Tested-by: John Garry <john.garry@huawei.com>
Acked-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/spi-nor/spi-nor.c

index 1d8621d43160de3da11a6ac668cd6f2654209807..7acf4a93b5923116f113f89e75f73cb8510c1faf 100644 (file)
@@ -487,7 +487,7 @@ static int write_sr(struct spi_nor *nor, u8 val)
                        SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WRSR, 1),
                                   SPI_MEM_OP_NO_ADDR,
                                   SPI_MEM_OP_NO_DUMMY,
-                                  SPI_MEM_OP_DATA_IN(1, nor->bouncebuf, 1));
+                                  SPI_MEM_OP_DATA_OUT(1, nor->bouncebuf, 1));
 
                return spi_mem_exec_op(nor->spimem, &op);
        }