pwm: Use conftest to find if pwm_ops has config

Use conftest to determine if pwm_ops struct has config
callback or not. This call back is deprecated from
commit 0829c35dc534 ("pwm: Drop support for legacy drivers")
in Linux 6.0.

Bug 4387902

Change-Id: Ic56d5955e5cfd15acb664fc11b549b9b91277182
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037039
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-18 11:47:47 +00:00
committed by mobile promotions
parent 9974fda1d2
commit b7cbe748e1
3 changed files with 19 additions and 3 deletions

View File

@@ -134,6 +134,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpiochip_find
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_config
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_core_deinit
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_disable_pcie_error_reporting
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_enable_pcie_error_reporting

View File

@@ -7163,6 +7163,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_PWM_OPS_STRUCT_HAS_OWNER" "" "types"
;;
pwm_ops_struct_has_config)
#
# Determine if the pwm_ops struct has config callback or not
#
# Removed from commit 0829c35dc534 ("pwm: Drop support for legacy drivers")
# in Linux 6.0
#
CODE="
#include <linux/pwm.h>
int conftest_pwm_ops_struct_has_owner(void) {
return offsetof(struct pwm_ops, config);
}"
compile_check_conftest "$CODE" "NV_PWM_OPS_STRUCT_HAS_CONFIG" "" "types"
;;
pci_epc_event_ops_struct_has_core_deinit)
#
# Determine if the pci_epc_event_ops struct has the core_deinit function.