tty: serial: ch384: Fix build for Linux v6.4

In Linux v6.4, the macro DEFINE_SEMAPHORE was updated and this breaks
the build for the ch384 serial driver. Add a new test to the conftest
script that checks if the macro DEFINE_SEMAPHORE takes a number argument
and use the definition created by conftest to select which version of
the macro is used.

Bug 4183168
Bug 4221847

Change-Id: Ie1bcb95b07e792c70fa52e22465bdf565dc456af
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989732
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-02 13:52:08 +01:00
committed by mobile promotions
parent ed130f099a
commit 86dafc35bb
4 changed files with 24 additions and 0 deletions

View File

@@ -90,6 +90,7 @@ endef
NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_remove_has_int_return_type
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_struct_devnode_has_const_dev_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_aperture_remove_framebuffers_has_drm_driver_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_driver_struct_has_irq_enabled_arg

View File

@@ -6332,6 +6332,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG" "" "types"
;;
define_semaphore_has_number_arg)
#
# Determine if the macro DEFINE_SEMAPHORE has a number argument.
#
# In Linux v6.4, 48380368dec1 ("Change DEFINE_SEMAPHORE() to
# take a number argument") updated the macro DEFINE_SEMAPHORE to
# take a number argument.
#
CODE="
#include <linux/semaphore.h>
DEFINE_SEMAPHORE(my_sem, 1);"
compile_check_conftest "$CODE" "NV_DEFINE_SEMAPHORE_HAS_NUMBER_ARG" "" "types"
;;
devm_thermal_of_zone_register)
#
# Determine whether devm_thermal_of_zone_register is present.