Commit 099ffd7e authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by David S. Miller
Browse files

NFC: NCI: use new `delay` structure for SPI transfer delays



In a recent change to the SPI subsystem [1], a new `delay` struct was added
to replace the `delay_usecs`. This change replaces the current `delay_secs`
with `delay` for this driver.

The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure
that both `delay_usecs` & `delay` are used (in this order to preserve
backwards compatibility).

[1] commit bebcfd27 ("spi: introduce `delay` field for
`spi_transfer` + spi_transfer_delay_exec()")

Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38ecd706
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ static int __nci_spi_send(struct nci_spi *nspi, struct sk_buff *skb,
		t.len = 0;
	}
	t.cs_change = cs_change;
	t.delay_usecs = nspi->xfer_udelay;
	t.delay.value = nspi->xfer_udelay;
	t.delay.unit = SPI_DELAY_UNIT_USECS;
	t.speed_hz = nspi->xfer_speed_hz;

	spi_message_init(&m);
@@ -216,7 +217,8 @@ static struct sk_buff *__nci_spi_read(struct nci_spi *nspi)
	rx.rx_buf = skb_put(skb, rx_len);
	rx.len = rx_len;
	rx.cs_change = 0;
	rx.delay_usecs = nspi->xfer_udelay;
	rx.delay.value = nspi->xfer_udelay;
	rx.delay.unit = SPI_DELAY_UNIT_USECS;
	rx.speed_hz = nspi->xfer_speed_hz;
	spi_message_add_tail(&rx, &m);