spi: aurix: Use conftest

Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I159cd7d5feca050c8a8014d9c2a3b43e8974fdfd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993807
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-10-09 13:12:50 +01:00
committed by mobile promotions
parent 610533a15d
commit f6e070f87e
3 changed files with 25 additions and 4 deletions

View File

@@ -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 <nvidia/conftest.h>
#include <linux/kthread.h>
#include <linux/module.h>
@@ -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
}