2
1

0001-Fix-Linux-6.13.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From f41f4a55e7787c9517ca6ac72f83dc244b4011e4 Mon Sep 17 00:00:00 2001
  2. From: Giulio Benetti <giulio.benetti@benettiengineering.com>
  3. Date: Sat, 5 Apr 2025 00:35:23 +0200
  4. Subject: [PATCH] Fix Linux 6.13
  5. With Linux commit:
  6. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0809a9ccac4a2ffdfd1561bb551aec6099775545
  7. spi_alloc_master() has been renamed to spi_alloc_host() so let's rename it
  8. accordingly checking for Linux version 6.13.0.
  9. Upstream: https://github.com/espressif/esp-hosted/pull/589
  10. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  11. ---
  12. esp_hosted_ng/host/spi/esp_spi.c | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. diff --git a/esp_hosted_ng/host/spi/esp_spi.c b/esp_hosted_ng/host/spi/esp_spi.c
  15. index 51df26d8d7..fc63487821 100644
  16. --- a/esp_hosted_ng/host/spi/esp_spi.c
  17. +++ b/esp_hosted_ng/host/spi/esp_spi.c
  18. @@ -394,7 +394,11 @@ static struct spi_controller *spi_busnum_to_master(u16 bus_num)
  19. pdev->num_resources = 0;
  20. platform_device_add(pdev);
  21. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
  22. + master = spi_alloc_host(&pdev->dev, sizeof(void *));
  23. +#else
  24. master = spi_alloc_master(&pdev->dev, sizeof(void *));
  25. +#endif
  26. if (!master) {
  27. pr_err("Error: failed to allocate SPI master device\n");
  28. platform_device_del(pdev);
  29. --
  30. 2.39.5