mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
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
(cherry picked from commit 0ed8b4e22a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032101
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
4a1a87890d
commit
09b54bda42
3
Makefile
3
Makefile
@@ -47,9 +47,6 @@ subdir-ccflags-y += -DNV_V4L2_ASYNC_MATCH_FWNODE_RENAME
|
||||
# Rename async_nf_init and v4l2_async_subdev_nf_register
|
||||
subdir-ccflags-y += -DNV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME
|
||||
|
||||
# PCIE EPF driver probe has additional argument as ID
|
||||
subdir-ccflags-y += -DNV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG
|
||||
|
||||
# Crypto driver has major change in it ops, skip it
|
||||
export CONFIG_SKIP_CRYPTO=y
|
||||
endif
|
||||
|
||||
@@ -733,7 +733,7 @@ static const struct pci_epc_event_ops nvscic2c_event_ops = {
|
||||
};
|
||||
|
||||
static int
|
||||
#if defined(NV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG)
|
||||
#if defined(NV_PCI_EPF_DRIVER_STRUCT_PROBE_HAS_ID_ARG) /* Linux 6.4 */
|
||||
nvscic2c_pcie_epf_probe(struct pci_epf *epf, const struct pci_epf_device_id *id)
|
||||
#else
|
||||
nvscic2c_pcie_epf_probe(struct pci_epf *epf)
|
||||
|
||||
@@ -266,7 +266,7 @@ static const struct pci_epc_event_ops pci_epf_dma_test_event_ops = {
|
||||
.core_deinit = pcie_dma_epf_core_deinit,
|
||||
};
|
||||
|
||||
#if defined(NV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG)
|
||||
#if defined(NV_PCI_EPF_DRIVER_STRUCT_PROBE_HAS_ID_ARG) /* Linux 6.4 */
|
||||
static int pcie_dma_epf_probe(struct pci_epf *epf, const struct pci_epf_device_id *id)
|
||||
#else
|
||||
static int pcie_dma_epf_probe(struct pci_epf *epf)
|
||||
|
||||
@@ -125,6 +125,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data
|
||||
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 += snd_soc_card_jack_new_has_no_snd_soc_jack_pins
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_component_driver_struct_has_non_legacy_dai_naming
|
||||
|
||||
@@ -7002,6 +7002,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
|
||||
|
||||
Reference in New Issue
Block a user