From e22b828db6622e3c4263086c70cd7d84756b653e Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Sat, 5 Apr 2025 00:47:00 +0200 Subject: [PATCH] package/esp-hosted: fix build failure with Linux 6.13.0 Add local patch pending upstream to fix renaming of spi_alloc_master() into spi_alloc_host() during Linux version 6.13.0. Fixes: https://autobuild.buildroot.org/results/68ce3721475d259a0db42b7ab84ef08ed7fba00c/ Signed-off-by: Giulio Benetti Signed-off-by: Julien Olivain --- package/esp-hosted/0001-Fix-Linux-6.13.patch | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/esp-hosted/0001-Fix-Linux-6.13.patch diff --git a/package/esp-hosted/0001-Fix-Linux-6.13.patch b/package/esp-hosted/0001-Fix-Linux-6.13.patch new file mode 100644 index 0000000000..98f86e8a8f --- /dev/null +++ b/package/esp-hosted/0001-Fix-Linux-6.13.patch @@ -0,0 +1,35 @@ +From f41f4a55e7787c9517ca6ac72f83dc244b4011e4 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Sat, 5 Apr 2025 00:35:23 +0200 +Subject: [PATCH] Fix Linux 6.13 + +With Linux commit: +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0809a9ccac4a2ffdfd1561bb551aec6099775545 +spi_alloc_master() has been renamed to spi_alloc_host() so let's rename it +accordingly checking for Linux version 6.13.0. + +Upstream: https://github.com/espressif/esp-hosted/pull/589 +Signed-off-by: Giulio Benetti +--- + esp_hosted_ng/host/spi/esp_spi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/esp_hosted_ng/host/spi/esp_spi.c b/esp_hosted_ng/host/spi/esp_spi.c +index 51df26d8d7..fc63487821 100644 +--- a/esp_hosted_ng/host/spi/esp_spi.c ++++ b/esp_hosted_ng/host/spi/esp_spi.c +@@ -394,7 +394,11 @@ static struct spi_controller *spi_busnum_to_master(u16 bus_num) + pdev->num_resources = 0; + platform_device_add(pdev); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) ++ master = spi_alloc_host(&pdev->dev, sizeof(void *)); ++#else + master = spi_alloc_master(&pdev->dev, sizeof(void *)); ++#endif + if (!master) { + pr_err("Error: failed to allocate SPI master device\n"); + platform_device_del(pdev); +-- +2.39.5 +