Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/pf: Remove inlined #ifdef CONFIG_PCI_IOV

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

+7 -4
-4
drivers/gpu/drm/xe/xe_pci.c
··· 748 748 if (!xe) /* driver load aborted, nothing to cleanup */ 749 749 return; 750 750 751 - #ifdef CONFIG_PCI_IOV 752 751 if (IS_SRIOV_PF(xe)) 753 752 xe_pci_sriov_configure(pdev, 0); 754 - #endif 755 753 756 754 xe_device_remove(xe); 757 755 xe_pm_runtime_fini(xe); ··· 1007 1009 .probe = xe_pci_probe, 1008 1010 .remove = xe_pci_remove, 1009 1011 .shutdown = xe_pci_shutdown, 1010 - #ifdef CONFIG_PCI_IOV 1011 1012 .sriov_configure = xe_pci_sriov_configure, 1012 - #endif 1013 1013 #ifdef CONFIG_PM_SLEEP 1014 1014 .driver.pm = &xe_pm_ops, 1015 1015 #endif
+7
drivers/gpu/drm/xe/xe_pci_sriov.h
··· 8 8 9 9 struct pci_dev; 10 10 11 + #ifdef CONFIG_PCI_IOV 11 12 int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs); 13 + #else 14 + static inline int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) 15 + { 16 + return 0; 17 + } 18 + #endif 12 19 13 20 #endif