diff --git a/drivers/spi/spi-aurix-tegra.c b/drivers/spi/spi-aurix-tegra.c index f9b91280..45a69d29 100644 --- a/drivers/spi/spi-aurix-tegra.c +++ b/drivers/spi/spi-aurix-tegra.c @@ -8,7 +8,6 @@ #include #include //#include -#include #include #define AURIX 0x3 @@ -372,7 +371,7 @@ static int aurix_tegra_start_kthread(struct device *dev) /* * remove, shutdown, suspend, resume functions */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) +#if defined(NV_SPI_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 5.18 */ static int aurix_tegra_spi_remove(struct spi_device *spi) { return aurix_tegra_stop_kthread(&spi->dev); diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index eefc6996..b86252fa 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -147,6 +147,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_dai_ops_struct_has_probe NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_of_get_dai_name_has_index_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_rtd_to_codec NV_CONFTEST_FUNCTION_COMPILE_TESTS += simple_util_dai_init +NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_driver_struct_remove_return_type_int NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 526b32d2..8ef61485 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7414,6 +7414,23 @@ compile_test() { compile_check_conftest "$CODE" "NV_ASOC_SIMPLE_RENAMED_SIMPLE" "" "functions" ;; + spi_driver_struct_remove_return_type_int) + # + # Determine if return type of .remove function of struct spi_driver is int or void. + # + # The return type of .remove is changed with commit a0386bba7093 ("spi: make remove + # callback a void function") in Linux 5.18. + # + CODE=" + #define _LINUX_EFI_H + #include + int conftest_spi_driver_struct_remove_return_type_int(struct spi_driver *spid) { + return spid->remove(NULL); + }" + + compile_check_conftest "$CODE" "NV_SPI_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT" "" "types" + ;; + tc_taprio_qopt_offload_struct_has_cmd) # # Determine if struct tc_taprio_qopt_offload has a member named cmd