UPSTREAM: SPI: Fix command-response behavior
Fix SPI flash ops regressions after commit:c2973d1spi: Get rid of SPI_ATOMIC_SEQUENCING When spi_flash_cmd() is called with argument response==NULL, only send out command without reading back the response. BUG=none BRANCH=none TEST=none Change-Id: I618a26349ff21649cc908562d19d8e367f2e24bd Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id:85b2b27e33Original-Change-Id: I28a94f208b4a1983d45d69d46db41391e267891d Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com> Original-Reviewed-on: https://review.coreboot.org/18082 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Timothy Pearson <tpearson@raptorengineering.com> Original-Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: https://chromium-review.googlesource.com/428242 Commit-Ready: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
48eb6025f6
commit
0bf36055be
1 changed files with 4 additions and 1 deletions
|
|
@ -49,11 +49,14 @@ static int do_spi_flash_cmd(const struct spi_slave *spi, const void *dout,
|
|||
[1] = { .dout = NULL, .bytesout = 0,
|
||||
.din = din, .bytesin = bytes_in },
|
||||
};
|
||||
size_t count = ARRAY_SIZE(vectors);
|
||||
if (!bytes_in)
|
||||
count = 1;
|
||||
|
||||
if (spi_claim_bus(spi))
|
||||
return ret;
|
||||
|
||||
if (spi_xfer_vector(spi, vectors, ARRAY_SIZE(vectors)) == 0)
|
||||
if (spi_xfer_vector(spi, vectors, count) == 0)
|
||||
ret = 0;
|
||||
|
||||
spi_release_bus(spi);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue