diff options
author | Alexandru Ardelean <alexandru.ardelean@analog.com> | 2019-09-26 12:51:40 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-15 12:45:19 +0200 |
commit | 867bd8868bbd16e17bbd26c5959abc3118902218 (patch) | |
tree | c2eeacbff467a46e8173604a635ba399a06a1378 /drivers/spi/spi-loopback-test.c | |
parent | spi: tegra20-sflash: use to new `spi_transfer_delay_exec` (diff) | |
download | linux-867bd8868bbd16e17bbd26c5959abc3118902218.tar.xz linux-867bd8868bbd16e17bbd26c5959abc3118902218.zip |
spi: spi-loopback-test: use new `delay` field
This change replaces the use of the `delay_usecs` field with the new
`delay` field. The code/test still uses micro-seconds, but they are now
configured and used via the `struct spi_delay` format of the `delay` field.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20190926105147.7839-13-alexandru.ardelean@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-loopback-test.c')
-rw-r--r-- | drivers/spi/spi-loopback-test.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c index 6f18d4952767..b6d79cd156fb 100644 --- a/drivers/spi/spi-loopback-test.c +++ b/drivers/spi/spi-loopback-test.c @@ -298,12 +298,18 @@ static struct spi_test spi_tests[] = { { .tx_buf = TX(0), .rx_buf = RX(0), - .delay_usecs = 1000, + .delay = { + .value = 1000, + .unit = SPI_DELAY_UNIT_USECS, + }, }, { .tx_buf = TX(0), .rx_buf = RX(0), - .delay_usecs = 1000, + .delay = { + .value = 1000, + .unit = SPI_DELAY_UNIT_USECS, + }, }, }, }, @@ -537,7 +543,7 @@ static int spi_test_check_elapsed_time(struct spi_device *spi, unsigned long long nbits = (unsigned long long)BITS_PER_BYTE * xfer->len; - delay_usecs += xfer->delay_usecs; + delay_usecs += xfer->delay.value; if (!xfer->speed_hz) continue; estimated_time += div_u64(nbits * NSEC_PER_SEC, xfer->speed_hz); |