From 64b442b57d88492bf9c7bf6743b61e6ec7d86c7e Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Sun, 12 Nov 2023 19:45:16 +0000 Subject: [PATCH] pci-epf: probe has additional APIs for Linux 6.6 The probe callback of driver "pci_epf_driver" has additonal APIs as pci_epf_device_id for Linux 6.6 and above. Add this new argument for Linux 6.6 and above. Bug 4374520 Change-Id: Ie744a98947b895fce83f1a9df598ddbee2c3d138 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3014991 GVS: Gerrit_Virtual_Submit --- Makefile | 3 +++ drivers/misc/nvscic2c-pcie/epf/module.c | 4 ++++ drivers/pci/endpoint/functions/pci-epf-dma-test.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/Makefile b/Makefile index cb273532..027a579b 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,9 @@ subdir-ccflags-y += -DNV_PCIE_DIABLE_PCIE_ERROR_REPORTING_DROP # PCIE DMA EPF core deinit not implemented in core kernel subdir-ccflags-y += -DNV_PCIE_DMA_EPF_CORE_DEINIT_NOT_AVAILABLE +# 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 diff --git a/drivers/misc/nvscic2c-pcie/epf/module.c b/drivers/misc/nvscic2c-pcie/epf/module.c index bf5cff5c..4500d9d6 100644 --- a/drivers/misc/nvscic2c-pcie/epf/module.c +++ b/drivers/misc/nvscic2c-pcie/epf/module.c @@ -739,7 +739,11 @@ static const struct pci_epc_event_ops nvscic2c_event_ops = { }; static int +#if defined(NV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG) +nvscic2c_pcie_epf_probe(struct pci_epf *epf, const struct pci_epf_device_id *id) +#else nvscic2c_pcie_epf_probe(struct pci_epf *epf) +#endif { int ret = 0; char *name = NULL; diff --git a/drivers/pci/endpoint/functions/pci-epf-dma-test.c b/drivers/pci/endpoint/functions/pci-epf-dma-test.c index e299174b..3303b59f 100644 --- a/drivers/pci/endpoint/functions/pci-epf-dma-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-dma-test.c @@ -270,7 +270,11 @@ static const struct pci_epc_event_ops pci_epf_dma_test_event_ops = { #endif }; +#if defined(NV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG) +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) +#endif { struct device *dev = &epf->dev; struct pcie_epf_dma *epfnv;