0010-Fix-build-with-Linux-6.10.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From 684eb3e40c88ee7a2cd4417a12b9b27a35e86655 Mon Sep 17 00:00:00 2001
  2. From: Giulio Benetti <giulio.benetti@benettiengineering.com>
  3. Date: Thu, 17 Apr 2025 18:41:07 +0200
  4. Subject: [PATCH] Fix build with Linux 6.10
  5. During commit:
  6. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9b163e0d330debbf7dcc14b2c3e2dc19a3b50a1d
  7. is_dma_mapped member has been dropped since it was not used anymore. The
  8. DMA mapping is done directly in single spi drivers in case it's supported
  9. so having is_dma_mapped set to 1 lead to code breakage. So we can consider
  10. it always as 0 and basically guard it if Linux version is 6.10+
  11. Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/8
  12. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  13. ---
  14. spi.c | 6 ++++++
  15. 1 file changed, 6 insertions(+)
  16. diff --git a/spi.c b/spi.c
  17. index f7b43e2..be616f4 100644
  18. --- a/spi.c
  19. +++ b/spi.c
  20. @@ -338,7 +338,9 @@ static int wilc_spi_tx(struct wilc *wilc, u8 *b, u32 len)
  21. memset(&msg, 0, sizeof(msg));
  22. spi_message_init(&msg);
  23. msg.spi = spi;
  24. +#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE
  25. msg.is_dma_mapped = USE_SPI_DMA;
  26. +#endif
  27. spi_message_add_tail(&tr, &msg);
  28. ret = spi_sync(spi, &msg);
  29. @@ -385,7 +387,9 @@ static int wilc_spi_rx(struct wilc *wilc, u8 *rb, u32 rlen)
  30. memset(&msg, 0, sizeof(msg));
  31. spi_message_init(&msg);
  32. msg.spi = spi;
  33. +#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE
  34. msg.is_dma_mapped = USE_SPI_DMA;
  35. +#endif
  36. spi_message_add_tail(&tr, &msg);
  37. ret = spi_sync(spi, &msg);
  38. @@ -427,7 +431,9 @@ static int wilc_spi_tx_rx(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen)
  39. memset(&msg, 0, sizeof(msg));
  40. spi_message_init(&msg);
  41. msg.spi = spi;
  42. +#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE
  43. msg.is_dma_mapped = USE_SPI_DMA;
  44. +#endif
  45. spi_message_add_tail(&tr, &msg);
  46. ret = spi_sync(spi, &msg);
  47. --
  48. 2.39.5