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 <johnliu@nvidia.com>
Change-Id: I5fca83c215adaf937a2acc81a943c455e2280a04
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197038
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
This commit is contained in:
Johnny Liu
2024-08-20 15:55:32 +00:00
committed by Jon Hunter
parent 872cead7b6
commit 66e40e599c
2 changed files with 18 additions and 0 deletions

View File

@@ -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_dev_iommu_get_stream_id
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map 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_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_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_write_has_u8_ptr_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg

View File

@@ -8093,6 +8093,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_THERMAL_ZONE_DEVICE_PRIV_PRESENT" "" "functions" 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 <linux/thermal.h>
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) tegra_dev_iommu_get_stream_id)
# #
# Determine if the function tegra_dev_iommu_get_stream_id is present. # Determine if the function tegra_dev_iommu_get_stream_id is present.