conftest: Add test to find if struct gpio_chip has of_node

Determine if struct gpio_chip has the of_node member or not.

The of_node from struct gpio_chip is removed from
commit 70d0fc4288dab ("gpiolib: Get rid of not
used of_node member") in Linux 6.2

Bug 4346767

Change-Id: I5ebc86beb7ce527f2e38693dd59907cdd3a8fcf9
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031548
(cherry picked from commit 05cf355367)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3051581
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-10 12:17:18 +00:00
committed by mobile promotions
parent c0beaa46b5
commit cef95180b3
2 changed files with 19 additions and 0 deletions

View File

@@ -126,6 +126,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight 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_get_named_gpio_flags
NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_gpio_named_count NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_gpio_named_count
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_disable_pcie_error_reporting NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_disable_pcie_error_reporting

View File

@@ -5462,6 +5462,24 @@ compile_test() {
compile_check_conftest "$CODE" "NV_OF_GPIO_NAMED_COUNT_PRESENT" "" "functions" compile_check_conftest "$CODE" "NV_OF_GPIO_NAMED_COUNT_PRESENT" "" "functions"
;; ;;
gpio_chip_struct_has_of_node_present)
#
# Determine if struct gpio_chip has the of_node member or not.
#
# The of_node from struct gpio_chip is removed from commit 70d0fc4288dab
# ("gpiolib: Get rid of not used of_node member") in Linux 6.2
#
CODE="
#include <linux/gpio/driver.h>
int conftest_gpio_chip_struct_has_of_node_present(void)
{
return offsetof(struct gpio_chip, of_node);
}
"
compile_check_conftest "$CODE" "NV_GPIO_CHIP_STRUCT_HAS_OF_NODE_PRESENT" "" "types"
;;
devm_gpio_request_one) devm_gpio_request_one)
# #
# Determine if devm_gpio_request_one() function is present # Determine if devm_gpio_request_one() function is present