diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 5bb08d68..4dc4d140 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -111,6 +111,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_dai_link_struct_has_c2c_params_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_of_get_dai_name_has_index_arg 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 diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 1e847028..a48db1a4 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6738,6 +6738,24 @@ compile_test() { "NV_SND_SOC_DAI_LINK_STRUCT_HAS_C2C_PARAMS_ARG" "" "types" ;; + snd_soc_of_get_dai_name_has_index_arg) + # + # Determine if the function 'snd_soc_of_get_dai_name()' has an index argument. + # + # In Linux v6.5, commit 3c8b5861850c ("ASoC: soc-core.c: add index on + # snd_soc_of_get_dai_name()") updated the arguments to the function + # snd_soc_of_get_dai_name(). + # + CODE=" + #include + int conftest_snd_soc_of_get_dai_name_has_index_args(struct device_node *np, + const char **name) { + return snd_soc_of_get_dai_name(np, name, 0); + }" + + compile_check_conftest "$CODE" "NV_SND_SOC_OF_GET_DAI_NAME_HAS_INDEX_ARG" "" "types" + ;; + tc_taprio_qopt_offload_struct_has_cmd) # # Determine if struct tc_taprio_qopt_offload has a member named cmd diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index e28a73e2..8d785cc5 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -245,7 +245,11 @@ static int parse_dai(struct device_node *node, if (ret) return ret; +#if defined(NV_SND_SOC_OF_GET_DAI_NAME_HAS_INDEX_ARG) + ret = snd_soc_of_get_dai_name(node, &dlc->dai_name, 0); +#else ret = snd_soc_of_get_dai_name(node, &dlc->dai_name); +#endif if (ret < 0) return ret;