Skip to content

Commit 21e2606

Browse files
commodobroonie
authored andcommitted
spi: orion: use new word_delay field for SPI transfers
The `word_delay` field had it's type changed to `struct spi_delay`. This allows users to specify nano-second or clock-cycle delays (if needed). Converting to use `word_delay` is straightforward: it just uses the new `spi_delay_exec()` routine, that handles the `unit` part. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 84593a1 commit 21e2606

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/spi/spi-orion.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
467467
if (orion_spi_write_read_8bit(spi, &tx, &rx) < 0)
468468
goto out;
469469
count--;
470-
if (xfer->word_delay_usecs)
471-
udelay(xfer->word_delay_usecs);
470+
spi_delay_exec(&xfer->word_delay, xfer);
472471
} while (count);
473472
} else if (word_len == 16) {
474473
const u16 *tx = xfer->tx_buf;
@@ -478,8 +477,7 @@ orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
478477
if (orion_spi_write_read_16bit(spi, &tx, &rx) < 0)
479478
goto out;
480479
count -= 2;
481-
if (xfer->word_delay_usecs)
482-
udelay(xfer->word_delay_usecs);
480+
spi_delay_exec(&xfer->word_delay, xfer);
483481
} while (count);
484482
}
485483

0 commit comments

Comments
 (0)