Currently the rx_buf does not get set with the
SPI_TEST_PATTERN_UNWRITTEN when tx_buf == NULL in the transfer.
Reorder code so that it gets done also under this specific condition.
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
/* fill all transfers with the pattern requested */
for (i = 0; i < test->transfer_count; i++) {
+ /* fill rx_buf with SPI_TEST_PATTERN_UNWRITTEN */
+ if (xfers[i].rx_buf)
+ memset(xfers[i].rx_buf, SPI_TEST_PATTERN_UNWRITTEN,
+ xfers[i].len);
/* if tx_buf is NULL then skip */
tx_buf = (u8 *)xfers[i].tx_buf;
if (!tx_buf)
return -EINVAL;
}
}
- /* fill rx_buf with SPI_TEST_PATTERN_UNWRITTEN */
- if (xfers[i].rx_buf)
- memset(xfers[i].rx_buf, SPI_TEST_PATTERN_UNWRITTEN,
- xfers[i].len);
}
return 0;