From 66e40e599c58da327251bf68070319513206c1c0 Mon Sep 17 00:00:00 2001 From: Johnny Liu Date: Tue, 20 Aug 2024 15:55:32 +0000 Subject: [PATCH] conftest: Check presence of get_trip_type Since Linux 6.5, get_trip_type function pointer is removed from thermal_zone_device_ops struct. For drivers that need to get the trip type should directly access trips array inside the thermal_zone_device struct. Bug 4740200 Signed-off-by: Johnny Liu Change-Id: I5fca83c215adaf937a2acc81a943c455e2280a04 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197038 GVS: buildbot_gerritrpt Reviewed-by: Laxman Dewangan --- scripts/conftest/Makefile | 1 + scripts/conftest/conftest.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index e6b7de28..e6dafa95 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -185,6 +185,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra264_chip_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map NV_CONFTEST_FUNCTION_COMPILE_TESTS += thermal_zone_device_priv +NV_CONFTEST_FUNCTION_COMPILE_TESTS += thermal_zone_device_ops_struct_has_get_trip_type NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 3e54c89e..a2cab3d4 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -8093,6 +8093,23 @@ compile_test() { compile_check_conftest "$CODE" "NV_THERMAL_ZONE_DEVICE_PRIV_PRESENT" "" "functions" ;; + thermal_zone_device_ops_struct_has_get_trip_type) + # + # Determine if the 'thermal_zone_device_ops' structure has the 'get_trip_type' function pointer. + # + # Commit 35d8dbbb25ad ("thermal: core: Drop unused .get_trip_*() + # callbacks") removed function get_trip_type function pointer in + # thermal_zone_device_ops struct in Linux v6.5. + # + CODE=" + #include + void conftest_thermal_zone_device_ops_has_get_trip_type(struct thermal_zone_device_ops *ops) { + ops->get_trip_type = NULL; + }" + + compile_check_conftest "$CODE" "NV_THERMAL_ZONE_DEVICE_OPS_STRUCT_HAS_GET_TRIP_TYPE" "" "types" + ;; + tegra_dev_iommu_get_stream_id) # # Determine if the function tegra_dev_iommu_get_stream_id is present.