diff --git a/drivers/media/platform/tegra/camera/vi/channel.c b/drivers/media/platform/tegra/camera/vi/channel.c index c4da4119..ccefb7fd 100644 --- a/drivers/media/platform/tegra/camera/vi/channel.c +++ b/drivers/media/platform/tegra/camera/vi/channel.c @@ -5,6 +5,8 @@ * Copyright (c) 2015-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ +#include + #include #include #include @@ -1886,7 +1888,7 @@ int tegra_channel_init_subdevices(struct tegra_channel *chan) int len = 0; /* set_stream of CSI */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#if defined(NV_MEDIA_ENTITY_REMOTE_PAD_PRESENT) /* Linux 6.0 */ pad = media_entity_remote_pad(&chan->pad); #else pad = media_pad_remote_pad_first(&chan->pad); @@ -1916,7 +1918,7 @@ int tegra_channel_init_subdevices(struct tegra_channel *chan) if (!(pad->flags & MEDIA_PAD_FL_SINK)) break; -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#if defined(NV_MEDIA_ENTITY_REMOTE_PAD_PRESENT) /* Linux 6.0 */ pad = media_entity_remote_pad(pad); #else pad = media_pad_remote_pad_first(pad); diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 893d0320..02dcd299 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -128,6 +128,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_map_has_gfp_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += kthread_complete_and_exit NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_read_c45 NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_write_c45 +NV_CONFTEST_FUNCTION_COMPILE_TESTS += media_entity_remote_pad NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_get_named_gpio_flags diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index b1f94f8d..2a06e202 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -945,6 +945,22 @@ compile_test() { compile_check_conftest "$CODE" "NV_MDEV_GET_TYPE_GROUP_ID_PRESENT" "" "functions" ;; + media_entity_remote_pad) + # + # Determine if media_entity_remote_pad() function is present or not + # + # Removed by commit b2e44430b634 ("media: mc-entity: Rename + # media_entity_remote_pad() to media_pad_remote_pad_first()") in Linux 6.0 + # + CODE=" + #include + void conftest_media_entity_remote_pad(void) { + media_entity_remote_pad(); + }" + + compile_check_conftest "$CODE" "NV_MEDIA_ENTITY_REMOTE_PAD_PRESENT" "" "functions" + ;; + vfio_device_mig_state) # # Determine if vfio_device_mig_state enum is present or not