From 5c7a0bb0cffc47a76923192034f5a6ba17ede33a Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 3 Dec 2019 11:03:55 +0100 Subject: drm/pci: Only build drm_pci.c if CONFIG_PCI is set Non-PCI systems should not build PCI helpers. Set up source code, header file and Makefile accordingly. Signed-off-by: Thomas Zimmermann Reviewed-by: Emil Velikov Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-2-tzimmermann@suse.de --- drivers/gpu/drm/drm_pci.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'drivers/gpu/drm/drm_pci.c') diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index a86a3ab2771c..40a2015abc77 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -125,8 +125,6 @@ void drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah) EXPORT_SYMBOL(drm_pci_free); -#ifdef CONFIG_PCI - static int drm_get_pci_domain(struct drm_device *dev) { #ifndef __alpha__ @@ -331,17 +329,6 @@ int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) } EXPORT_SYMBOL(drm_legacy_pci_init); -#else - -void drm_pci_agp_destroy(struct drm_device *dev) {} - -int drm_irq_by_busid(struct drm_device *dev, void *data, - struct drm_file *file_priv) -{ - return -EINVAL; -} -#endif - /** * drm_legacy_pci_exit - unregister shadow-attach legacy DRM driver * @driver: DRM device driver -- cgit From 1be9d5f069964108125592af92304da76c5865bf Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 3 Dec 2019 11:03:56 +0100 Subject: drm/pci: Hide legacy PCI functions from non-legacy code Declarations of drm_legacy_pci_{init,exit}() are being moved to drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation. Signed-off-by: Thomas Zimmermann Reviewed-by: Emil Velikov Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-3-tzimmermann@suse.de --- drivers/gpu/drm/drm_pci.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/gpu/drm/drm_pci.c') diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 40a2015abc77..f2e43d341980 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -282,6 +282,8 @@ err_free: } EXPORT_SYMBOL(drm_get_pci_dev); +#ifdef CONFIG_DRM_LEGACY + /** * drm_legacy_pci_init - shadow-attach a legacy DRM PCI driver * @driver: DRM device driver @@ -354,3 +356,5 @@ void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) DRM_INFO("Module unloaded\n"); } EXPORT_SYMBOL(drm_legacy_pci_exit); + +#endif -- cgit