diff --git a/drivers/spi/spi-aurix-tegra.c b/drivers/spi/spi-aurix-tegra.c index 331f8862..f9b91280 100644 --- a/drivers/spi/spi-aurix-tegra.c +++ b/drivers/spi/spi-aurix-tegra.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +// Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. + +#include #include #include @@ -244,10 +246,10 @@ ret: spin_lock_irqsave(&aurix_data->lock, flags); aurix_data->exited = true; spin_unlock_irqrestore(&aurix_data->lock, flags); -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) - complete_and_exit(NULL, err); -#else +#if defined(NV_KTHREAD_COMPLETE_AND_EXIT_PRESENT) /* Linux v5.17 */ kthread_complete_and_exit(NULL, err); +#else + complete_and_exit(NULL, err); #endif } diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 83d15749..e6663cb6 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -114,6 +114,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_ringparam_has_ringpara NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_user_pages NV_CONFTEST_FUNCTION_COMPILE_TESTS += iio_dev_opaque_has_mlock NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_map_has_gfp_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += kthread_complete_and_exit NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index d4687968..d8867862 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6861,6 +6861,24 @@ compile_test() { compile_check_conftest "$CODE" "NV_IIO_DEV_OPAQUE_HAS_LOCK" "" "types" ;; + kthread_complete_and_exit) + # + # Determine if function kthread_complete_and_exit() is present. + # + # This function was added in Linux v5.17 by commit cead18552660 + # ("exit: Rename complete_and_exit to kthread_complete_and_exit"). + # + CODE=" + #include + void conftest_kthread_complete_and_exit(void) + { + kthread_complete_and_exit(); + } + " + + compile_check_conftest "$CODE" "NV_KTHREAD_COMPLETE_AND_EXIT_PRESENT" "" "functions" + ;; + register_shrinker_has_fmt_arg) # # Determine if the 'register_shrinker' function