media: camera: Update conftest for gpio_device_find

When adding conftest tests for detecting if specific functions are
present, it is always better to check if the newly added function is
present versus the function that has been removed. The reason being that
is the newly added function is modified in the future then the conftest
tests can be extended to check for updates to the function.

Therefore, instead of checking if the function gpiochip_find() is
present, which was removed in Linux v6.7, check if the function
gpio_device_find() is present, which replaced gpiochip_find in Linux
v6.7.

Bug 4346767
Bug 4471899

Change-Id: I32bf1c3da32abbf3c8d3ef9ea350decf1564e0bc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3108643
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2024-04-03 11:46:43 +01:00
committed by mobile promotions
parent a3466295e1
commit 68e7840dd8
4 changed files with 33 additions and 31 deletions

View File

@@ -5524,24 +5524,6 @@ compile_test() {
compile_check_conftest "$CODE" "NV_GPIO_CHIP_STRUCT_HAS_OF_NODE_PRESENT" "" "types"
;;
gpiochip_find)
#
# Determine if function gpiochip_find() present or not.
#
# The function gpiochip_find() is removed from commit 2654521d774f9
# ("gpiolib: remove gpiochip_find()" in Linux 6.7
#
CODE="
#include <linux/gpio/driver.h>
void conftest_gpiochip_find_present(void)
{
gpiochip_find();
}
"
compile_check_conftest "$CODE" "NV_GPIOCHIP_FIND_PRESENT" "" "functions"
;;
devm_gpio_request_one)
#
# Determine if devm_gpio_request_one() function is present
@@ -7095,6 +7077,26 @@ compile_test() {
compile_check_conftest "$CODE" "NV_GENDPD_XLATE_T_HAS_CONST_OF_PHANDLE_ARGS" "" "types"
;;
gpio_device_find)
#
# Determine if function gpio_device_find() present.
#
# The function gpio_device_find() was add by commit cfe102f63308
# ("gpiolib: provide gpio_device_find()") in Linux v6.7 replacing
# the legacy and broken gpiochip_find(), which has since been
# removed.
#
CODE="
#include <linux/gpio/driver.h>
void conftest_gpio_device_find(void)
{
gpio_device_find();
}
"
compile_check_conftest "$CODE" "NV_GPIO_DEVICE_FIND_PRESENT" "" "functions"
;;
netif_set_tso_max_size)
#
# Determine if netif_set_tso_max_size() function is present