mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
spi: Use conftest to find return type of .remove of spi_driver struct
Use conftest to determine the return type of .remove() of
struct spi_driver is int or void type instead of kernel version.
The return type got changed with commit a0386bba7093
("spi: make remove callback a void function") in Linux 5.18
Bug 4387902
Change-Id: I644fe0610a76fbc4cea547c3295670599ae919bc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037038
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
49988960d1
commit
9974fda1d2
@@ -8,7 +8,6 @@
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/spi/spi.h>
|
||||
//#include <soc/tegra/virt/tegra_hv_pm_ctl.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/sched/signal.h>
|
||||
|
||||
#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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <linux/spi/spi.h>
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user