From c393fbae0226e9ad8719a516bec66bb2b8bbfcb6 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 25 Feb 2020 17:58:35 +0100 Subject: drm/pci: Unexport drm_get_pci_dev Only user left is the shadow attach for legacy drivers. v2: Shift the #ifdef CONFIG_DRM_LEGACY to now also include drm_get_pci_dev() (Thomas) Cc: Thomas Zimmermann Cc: Emil Velikov Cc: Alex Deucher Reviewed-by: Thomas Zimmermann Reviewed-by: Emil Velikov Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20200225165835.2394442-1-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_pci.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 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 c6bb98729a26..5218475ad7e7 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -75,7 +75,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali return dmah; } - EXPORT_SYMBOL(drm_pci_alloc); /** @@ -191,23 +190,11 @@ void drm_pci_agp_destroy(struct drm_device *dev) } } -/** - * drm_get_pci_dev - Register a PCI device with the DRM subsystem - * @pdev: PCI device - * @ent: entry from the PCI ID table that matches @pdev - * @driver: DRM device driver - * - * Attempt to gets inter module "drm" information. If we are first - * then register the character device and inter module information. - * Try and register, if we fail to register, backout previous work. - * - * NOTE: This function is deprecated, please use drm_dev_alloc() and - * drm_dev_register() instead and remove your &drm_driver.load callback. - * - * Return: 0 on success or a negative error code on failure. - */ -int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, - struct drm_driver *driver) +#ifdef CONFIG_DRM_LEGACY + +static int drm_get_pci_dev(struct pci_dev *pdev, + const struct pci_device_id *ent, + struct drm_driver *driver) { struct drm_device *dev; int ret; @@ -250,9 +237,6 @@ err_free: drm_dev_put(dev); return ret; } -EXPORT_SYMBOL(drm_get_pci_dev); - -#ifdef CONFIG_DRM_LEGACY /** * drm_legacy_pci_init - shadow-attach a legacy DRM PCI driver -- cgit v1.2.3 From ee21ec7767621c1adb0a388e0e7d841674cdc43f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 7 Mar 2020 09:37:02 +0000 Subject: drm: Make drm_pci_agp_init legacy Pull the drm_pci_agp_init() underneath the legacy ifdeffry alongside its only caller. The diff chooses it to so it by moving drm_pci_agp_destroy earlier, but the important bit is moving the #ifdef earlier before drm_pci_agp_init. Signed-off-by: Chris Wilson Acked-by: Sam Ravnborg Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20200307093702.2269-1-chris@chris-wilson.co.uk --- drivers/gpu/drm/drm_pci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 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 5218475ad7e7..81aa21561982 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -166,6 +166,18 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, return drm_pci_irq_by_busid(dev, p); } +void drm_pci_agp_destroy(struct drm_device *dev) +{ + if (dev->agp) { + arch_phys_wc_del(dev->agp->agp_mtrr); + drm_legacy_agp_clear(dev); + kfree(dev->agp); + dev->agp = NULL; + } +} + +#ifdef CONFIG_DRM_LEGACY + static void drm_pci_agp_init(struct drm_device *dev) { if (drm_core_check_feature(dev, DRIVER_USE_AGP)) { @@ -180,18 +192,6 @@ static void drm_pci_agp_init(struct drm_device *dev) } } -void drm_pci_agp_destroy(struct drm_device *dev) -{ - if (dev->agp) { - arch_phys_wc_del(dev->agp->agp_mtrr); - drm_legacy_agp_clear(dev); - kfree(dev->agp); - dev->agp = NULL; - } -} - -#ifdef CONFIG_DRM_LEGACY - static int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver) -- cgit v1.2.3