]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/xe/pf: Remove inlined #ifdef CONFIG_PCI_IOV
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 27 Jun 2024 10:43:05 +0000 (12:43 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 1 Jul 2024 16:01:31 +0000 (18:01 +0200)
We can remove #ifdef CONFIG_PCI_IOV in .c files if we provide
dummy replacement of the xe_pci_sriov_configure() function.

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Francois Dugast <francois.dugast@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240627104305.1477-1-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_pci_sriov.h

index f5d5a368e5959b6bbfef54b79dc7cb1f4226e9c5..732ee0d02124f7139fd856e2f9f949daf3353fc9 100644 (file)
@@ -748,10 +748,8 @@ static void xe_pci_remove(struct pci_dev *pdev)
        if (!xe) /* driver load aborted, nothing to cleanup */
                return;
 
-#ifdef CONFIG_PCI_IOV
        if (IS_SRIOV_PF(xe))
                xe_pci_sriov_configure(pdev, 0);
-#endif
 
        xe_device_remove(xe);
        xe_pm_runtime_fini(xe);
@@ -1009,9 +1007,7 @@ static struct pci_driver xe_pci_driver = {
        .probe = xe_pci_probe,
        .remove = xe_pci_remove,
        .shutdown = xe_pci_shutdown,
-#ifdef CONFIG_PCI_IOV
        .sriov_configure = xe_pci_sriov_configure,
-#endif
 #ifdef CONFIG_PM_SLEEP
        .driver.pm = &xe_pm_ops,
 #endif
index 3b8bfbf7e1d96a738892b43aa6b683982858b65c..c76dd0d90495e79234f1f8f7ace129998a79a5d7 100644 (file)
@@ -8,6 +8,13 @@
 
 struct pci_dev;
 
+#ifdef CONFIG_PCI_IOV
 int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs);
+#else
+static inline int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
+{
+       return 0;
+}
+#endif
 
 #endif