hwmon: f75308: Fix build for Linux v6.11

The macro of_property_for_each_u32() was updated for Linux v6.11 to
remove two of the arguments that were only used internally in the macro
and do not need to be passed. Add a test to conftest to detect the
version of the of_property_for_each_u32() that is present in the kernel
and fix the f75308 driver accordingly.

Bug 4749580

Change-Id: If787a40d0af49989d93d9563dd6a84e906cb5209
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3184092
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-07-29 12:03:46 +01:00
committed by mobile promotions
parent a30f14e5b3
commit 8f1e881a2f
3 changed files with 32 additions and 1 deletions

View File

@@ -146,6 +146,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_get_named_gpio_flags
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_find
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_get_chip
NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_property_for_each_u32_removed_internal_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data
NV_CONFTEST_FUNCTION_COMPILE_TESTS += platform_msi_domain_alloc_irqs
NV_CONFTEST_FUNCTION_COMPILE_TESTS += platform_msi_domain_free_irqs

View File

@@ -7438,6 +7438,30 @@ compile_test() {
compile_check_conftest "$CODE" "NV_MODULE_IMPORT_NS_PRESENT" "" "types"
;;
of_property_for_each_u32_removed_internal_args)
#
# Determine if the internal arguments for the macro
# of_property_for_each_u32() have been removed.
#
# Commit 9722c3b66e21 ("of: remove internal arguments from
# of_property_for_each_u32()") removes two arguments from
# of_property_for_each_u32() which are used internally within
# the macro and so do not need to be passed. This change was
# made for Linux v6.11.
#
CODE="
#include <linux/of.h>
void conftest_of_property_for_each_u32(struct device_node *np,
char *propname) {
u32 val;
of_property_for_each_u32(np, propname, val)
pr_info(\"val %u\n\", val);
}"
compile_check_conftest "$CODE" "NV_OF_PROPERTY_FOR_EACH_REMOVED_INTERNAL_ARGS" "" "types"
;;
platform_msi_domain_alloc_irqs)
#
# Determine if the platform_msi_domain_alloc_irqs() API available or not.