mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
spi: spi-mem: Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum
When defining spi_mem_op templates we don't necessarily know the size that will be passed when the template is actually used, and basing the supports_op() check on op->data.nbytes to know whether there will be data transferred for a specific operation is this not possible. Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum so that we can base our checks on op->data.dir instead of op->data.nbytes. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
6afe76a672
commit
0ebb261a0b
2 changed files with 3 additions and 1 deletions
|
|
@ -142,7 +142,7 @@ static bool spi_mem_default_supports_op(struct spi_mem *mem,
|
|||
spi_check_buswidth_req(mem, op->dummy.buswidth, true))
|
||||
return false;
|
||||
|
||||
if (op->data.nbytes &&
|
||||
if (op->data.dir != SPI_MEM_NO_DATA &&
|
||||
spi_check_buswidth_req(mem, op->data.buswidth,
|
||||
op->data.dir == SPI_MEM_DATA_OUT))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue