diff mbox series

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

Message ID 20200420221615.14734-8-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to version 5.7-rc2 | expand

Commit Message

Hauke Mehrtens April 20, 2020, 10:16 p.m. UTC
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 <hauke@hauke-m.de>
---
 patches/0095-spi-delay/libertas.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 patches/0095-spi-delay/libertas.patch
diff mbox series

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 */