diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c index 516e7479..c6db15c7 100644 --- a/drivers/gpu/drm/tegra/gr2d.c +++ b/drivers/gpu/drm/tegra/gr2d.c @@ -10,7 +10,6 @@ #include #include #include -#include #include @@ -272,7 +271,7 @@ static int gr2d_probe(struct platform_device *pdev) gr2d->client.version = gr2d->soc->version; gr2d->client.ops = &gr2d_ops; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) +#if defined(NV_DEVM_TEGRA_CORE_DEV_INIT_OPP_TABLE_COMMON_PRESENT) /* Linux v5.17 */ err = devm_tegra_core_dev_init_opp_table_common(dev); if (err) return err; diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c index db5e9ecb..d55158b3 100644 --- a/drivers/gpu/drm/tegra/gr3d.c +++ b/drivers/gpu/drm/tegra/gr3d.c @@ -530,7 +530,7 @@ static int gr3d_probe(struct platform_device *pdev) gr3d->client.version = gr3d->soc->version; gr3d->client.ops = &gr3d_ops; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) +#if defined(NV_DEVM_TEGRA_CORE_DEV_INIT_OPP_TABLE_COMMON_PRESENT) /* Linux v5.17 */ err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev); if (err) return err; diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 944d7e15..1b7c5a12 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1879,7 +1879,7 @@ static int tegra_hdmi_probe(struct platform_device *pdev) if (err) return err; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) +#if defined(NV_DEVM_TEGRA_CORE_DEV_INIT_OPP_TABLE_COMMON_PRESENT) /* Linux v5.17 */ err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev); if (err) return err; diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 55c8695e..9b1bb1e4 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -5,6 +5,8 @@ * Copyright (c) 2010-2023, NVIDIA CORPORATION & AFFILIATES. All Rights Reserved. */ +#include + #include #include #include @@ -15,7 +17,6 @@ #include #include #include -#include #include @@ -950,7 +951,7 @@ static int host1x_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) +#if defined(NV_DEVM_TEGRA_CORE_DEV_INIT_OPP_TABLE_COMMON_PRESENT) /* Linux v5.17 */ err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev); if (err) goto pm_disable; diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 5cb013a2..064b8a4b 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -100,6 +100,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_create_has_no_owner_arg 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 += device_add_disk_has_int_return_type +NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_tegra_core_dev_init_opp_table_common NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register NV_CONFTEST_FUNCTION_COMPILE_TESTS += disk_check_media_change NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_slave_config_struct_has_slave_id diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 6db9a60c..0f69060b 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6553,6 +6553,24 @@ compile_test() { compile_check_conftest "$CODE" "NV_DEVICE_ADD_DISK_HAS_INT_RETURN_TYPE" "" "types" ;; + devm_tegra_core_dev_init_opp_table_common) + # + # Determine whether devm_tegra_core_dev_init_opp_table_common is + # present. + # + # devm_tegra_core_dev_init_opp_table_common was added in commit + # 9131c6331726 ("soc/tegra: Add devm_tegra_core_dev_init_opp_table_common()") + # in Linux v5.17. + # + CODE=" + #include + void conftest_devm_tegra_core_dev_init_opp_table_common(void) { + devm_tegra_core_dev_init_opp_table_common(); + }" + + compile_check_conftest "$CODE" "NV_DEVM_TEGRA_CORE_DEV_INIT_OPP_TABLE_COMMON_PRESENT" "" "functions" + ;; + devm_thermal_of_zone_register) # # Determine whether devm_thermal_of_zone_register is present.