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