diff options
| -rw-r--r-- | drivers/spi/spi-loopback-test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c index 7f497acc906c..8af2e4070153 100644 --- a/drivers/spi/spi-loopback-test.c +++ b/drivers/spi/spi-loopback-test.c | |||
| @@ -591,6 +591,10 @@ static int spi_test_fill_tx(struct spi_device *spi, struct spi_test *test) | |||
| 591 | 591 | ||
| 592 | /* fill all transfers with the pattern requested */ | 592 | /* fill all transfers with the pattern requested */ |
| 593 | for (i = 0; i < test->transfer_count; i++) { | 593 | for (i = 0; i < test->transfer_count; i++) { |
| 594 | /* fill rx_buf with SPI_TEST_PATTERN_UNWRITTEN */ | ||
| 595 | if (xfers[i].rx_buf) | ||
| 596 | memset(xfers[i].rx_buf, SPI_TEST_PATTERN_UNWRITTEN, | ||
| 597 | xfers[i].len); | ||
| 594 | /* if tx_buf is NULL then skip */ | 598 | /* if tx_buf is NULL then skip */ |
| 595 | tx_buf = (u8 *)xfers[i].tx_buf; | 599 | tx_buf = (u8 *)xfers[i].tx_buf; |
| 596 | if (!tx_buf) | 600 | if (!tx_buf) |
| @@ -648,10 +652,6 @@ static int spi_test_fill_tx(struct spi_device *spi, struct spi_test *test) | |||
| 648 | return -EINVAL; | 652 | return -EINVAL; |
| 649 | } | 653 | } |
| 650 | } | 654 | } |
| 651 | /* fill rx_buf with SPI_TEST_PATTERN_UNWRITTEN */ | ||
| 652 | if (xfers[i].rx_buf) | ||
| 653 | memset(xfers[i].rx_buf, SPI_TEST_PATTERN_UNWRITTEN, | ||
| 654 | xfers[i].len); | ||
| 655 | } | 655 | } |
| 656 | 656 | ||
| 657 | return 0; | 657 | return 0; |
