From f78f96de71fb7e4565b22902519fe5270e7da045 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Sun, 10 Dec 2023 06:56:15 +0000 Subject: [PATCH] conftest: Add test to find of_get_named_gpio_flags() Add test to find out if of_get_named_gpio_flags() present or not. This APIS is removed in commit 40fc56ee608cdb ("gpiolib: of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags()") in Linux 6.2. Bug 4346767 Change-Id: I522097bdeb5fbd5a545b981a1a9b3f6f7ecb2806 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031546 Tested-by: mobile promotions Reviewed-by: mobile promotions --- scripts/conftest/Makefile | 1 + scripts/conftest/conftest.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 2eba2573..40a6c2ea 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -127,6 +127,7 @@ 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 += netif_set_tso_max_size NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight +NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_get_named_gpio_flags NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_core_deinit diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index edbc101a..e470c2d3 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -5454,6 +5454,27 @@ compile_test() { compile_check_conftest "$CODE" "NV_OF_GET_NAME_GPIO_PRESENT" "" "functions" ;; + of_get_named_gpio_flags) + # + # Determine if of_get_named_gpio_flags() function is present + # + # This APIS is removed in commit 40fc56ee608cdb ("gpiolib: + # of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags()") + # in Linux 6.2. + # + CODE=" + #if defined(NV_LINUX_OF_GPIO_H_PRESENT) + #include + #endif + void conftest_of_get_named_gpio_flags(void) + { + of_get_named_gpio_flags(); + } + " + + compile_check_conftest "$CODE" "NV_OF_GET_NAMED_GPIO_FLAGS_PRESENT" "" "functions" + ;; + devm_gpio_request_one) # # Determine if devm_gpio_request_one() function is present