From c0beaa46b57b2bde4b8915655efbc427e2eadeb9 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Sun, 10 Dec 2023 11:01:47 +0000 Subject: [PATCH] conftest: Add test to find of_gpio_named_count() Add conftest to find if of_gpio_named_count() function is present. This APIS is removed in commit c7835652a85df ("gpiolib: of: stop exporting of_gpio_named_count()") in Linux 6.2. Bug 4346767 Change-Id: Ia8339a4f0c7bfcbeed922c7045330ae2ba83f96c Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031547 (cherry picked from commit 5f188c61f5c89e0e5cd3f8e51451f5831bd55efa) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3051585 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 7b1afe81..afa87669 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -125,6 +125,7 @@ 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 += of_gpio_named_count NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_disable_pcie_error_reporting diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 5800572d..6b95a868 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -5441,6 +5441,27 @@ compile_test() { compile_check_conftest "$CODE" "NV_OF_GET_NAMED_GPIO_FLAGS_PRESENT" "" "functions" ;; + of_gpio_named_count) + # + # Determine if of_gpio_named_count() function is present + # + # This APIS is removed in commit c7835652a85 ("gpiolib: of: stop + # exporting of_gpio_named_count()") + # in Linux 6.2. + # + CODE=" + #if defined(NV_LINUX_OF_GPIO_H_PRESENT) + #include + #endif + void conftest_of_gpio_named_count(void) + { + of_gpio_named_count(); + } + " + + compile_check_conftest "$CODE" "NV_OF_GPIO_NAMED_COUNT_PRESENT" "" "functions" + ;; + devm_gpio_request_one) # # Determine if devm_gpio_request_one() function is present