0001-esp_hosted_ng-fix-build-failure-on-Linux-6.9.0.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 1cd8671eb64a1278466e7a9c90ceca1be0f8c0d5 Mon Sep 17 00:00:00 2001
  2. From: Giulio Benetti <giulio.benetti@benettiengineering.com>
  3. Date: Mon, 1 Apr 2024 17:15:19 +0200
  4. Subject: [PATCH] esp_hosted_ng: fix build failure on Linux 6.9.0
  5. With Linux commit:
  6. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=620d269f29a569ba37419cc03cf1da2d55f6252a
  7. spi_master compatibility has gone, so let's redefine missing needed
  8. macros spi_master and spi_master_put() locally if Linux version is >=
  9. 6.9.0.
  10. Upstream: https://github.com/espressif/esp-hosted/pull/358
  11. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  12. ---
  13. esp_hosted_ng/host/spi/esp_spi.c | 5 +++++
  14. 1 file changed, 5 insertions(+)
  15. diff --git a/esp_hosted_ng/host/spi/esp_spi.c b/esp_hosted_ng/host/spi/esp_spi.c
  16. index d0bd513bd6..9817056b2d 100644
  17. --- a/esp_hosted_ng/host/spi/esp_spi.c
  18. +++ b/esp_hosted_ng/host/spi/esp_spi.c
  19. @@ -378,6 +378,11 @@ static int __spi_controller_match(struct device *dev, const void *data)
  20. return ctlr->bus_num == *bus_num;
  21. }
  22. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0))
  23. +#define spi_master spi_controller
  24. +#define spi_master_put(_ctlr) spi_controller_put(_ctlr)
  25. +#endif
  26. +
  27. static struct spi_controller *spi_busnum_to_master(u16 bus_num)
  28. {
  29. struct platform_device *pdev = NULL;
  30. --
  31. 2.34.1