]> git.baikalelectronics.ru Git - uboot.git/commit
mtd: spi-nor-core: Do not set data direction when there is no data
authorPratyush Yadav <p.yadav@ti.com>
Fri, 25 Jun 2021 19:17:15 +0000 (00:47 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 28 Jun 2021 06:29:47 +0000 (11:59 +0530)
commit0b816c649c4d338f4a27d115005c98c530e9a5fc
tree925882760bcf92cd731662c09dd75704199c7128
parentaca15ed68df8c5d26f048e0c612aca8fcdc05b90
mtd: spi-nor-core: Do not set data direction when there is no data

Even when spi_nor_write_reg() has no data to write, like when executing
a write enable operation, it sets the data direction to
SPI_MEM_DATA_OUT. This trips up spi_mem_check_buswidth() because it
expects a data phase when there is none. Make sure the data direction is
set to SPI_MEM_NO_DATA when there is no data to write.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/mtd/spi/spi-nor-core.c