[PATCH 7/9] backports: patches: avoid struct spi_delay usage

Hauke Mehrtens <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
The struct spi_transfer got a new member "struct spi_delay delay" in
upstream commit bebcfd272df6 ("spi: introduce `delay` field for
`spi_transfer` + spi_transfer_delay_exec()"), use the older interface in
older kernel versions.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
 patches/0095-spi-delay/libertas.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 patches/0095-spi-delay/libertas.patch

diff --git a/patches/0095-spi-delay/libertas.patch b/patches/0095-spi-delay/libertas.patch
new file mode 100644
index 00000000..4a4e59a1
--- /dev/null
+++ b/patches/0095-spi-delay/libertas.patch
@@ -0,0 +1,17 @@
+--- a/drivers/net/wireless/marvell/libertas/if_spi.c
++++ b/drivers/net/wireless/marvell/libertas/if_spi.c
+@@ -235,9 +235,14 @@ static int spu_read(struct if_spi_card *
+ 		spi_message_add_tail(&dummy_trans, &m);
+ 	} else {
+ 		/* Busy-wait while the SPU fills the FIFO */
++#if LINUX_VERSION_IS_GEQ(5,5,0)
+ 		reg_trans.delay.value =
+ 			DIV_ROUND_UP((100 + (delay * 10)), 1000);
+ 		reg_trans.delay.unit = SPI_DELAY_UNIT_USECS;
++#else
++		reg_trans.delay_usecs =
++			DIV_ROUND_UP((100 + (delay * 10)), 1000);
++#endif /* >= 5.5 */
+ 	}
+ 
+ 	/* read in data */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.