media: camera: Ensure gpio_device_get_chip is present

In Linux v6.7, both gpio_device_find() and gpio_device_get_chip() were
added. However, don't assume that if one is present then so is the other
and so add a test to check if gpio_device_get_chip() is also present.

Bug 4471899

Change-Id: I0c547a52b0f397aef43884ab76d815573e8ed3f8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3112133
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-04-09 11:56:40 +01:00
committed by mobile promotions
parent 338d28218c
commit 9458d6b97f
4 changed files with 26 additions and 4 deletions

View File

@@ -137,6 +137,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight
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 += pde_data
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_chip_struct_has_base_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner

View File

@@ -7125,6 +7125,23 @@ compile_test() {
fi
;;
gpio_device_get_chip)
#
# Determine if function gpio_device_get_chip() is present.
#
# Added by commit 9b418780844c ("gpiolib: reluctantly provide
# gpio_device_get_chip()") in Linux v6.7.
#
CODE="
#include <linux/gpio/driver.h>
void conftest_gpio_device_get_chip(void)
{
gpio_device_get_chip();
}"
compile_check_conftest "$CODE" "NV_GPIO_DEVICE_GET_CHIP_PRESENT" "" "functions"
;;
netif_set_tso_max_size)
#
# Determine if netif_set_tso_max_size() function is present