pci: Use conftest to find if probe of pci_epf_driver has ID arg

Use conftest to determine if the struct pci_epf_driver probe
API has ID argument or not

The additional argument as ID is added in probe() of the
struct pci_epf_driver with commit 081c715dfd5054 ("PCI:
endpoint: Pass EPF device ID to the probe function")
in Linux 6.4.

Bug 4346767

Change-Id: I004d1d3a8df922c0534c5631baa26f82f6992e4d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3030052
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-07 08:28:51 +00:00
committed by mobile promotions
parent 3839cecd1c
commit 0ed8b4e22a
5 changed files with 20 additions and 5 deletions

View File

@@ -129,6 +129,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner
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
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epf_driver_struct_probe_has_id_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += shrinker_alloc
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_card_jack_new_has_no_snd_soc_jack_pins

View File

@@ -7067,6 +7067,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_PCI_ENABLE_PCIE_ERROR_REPORTING_PRESENT" "" "functions"
;;
pci_epf_driver_struct_probe_has_id_arg)
#
# Determine if the struct pci_epf_driver probe API has ID argument or not.
#
# The additional argument as ID is added in probe() of the struct pci_epf_driver
# with change 081c715dfd5054 ("PCI: endpoint: Pass EPF device ID to the probe function")
# in Linux 6.4.
#
CODE="
#include <linux/pci-epf.h>
void conftest_pci_epf_driver_struct_probe_has_id_arg(struct pci_epf_driver *epfd) {
epfd->probe(NULL);
}"
compile_check_conftest "$CODE" "NV_PCI_EPF_DRIVER_STRUCT_PROBE_HAS_ID_ARG" "" "functions"
;;
register_shrinker_has_fmt_arg)
#
# Determine if the 'register_shrinker' function