diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-07 12:37:02 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-09 12:22:50 +0300 |
commit | ee21ec7767621c1adb0a388e0e7d841674cdc43f (patch) | |
tree | 1ecb4f1509c3b6eb3c6fe93391f9c66862d0050f /drivers/gpu/drm/drm_pci.c | |
parent | 7e4f6fb354089e42236241ed6a8e19a8b84638df (diff) | |
download | linux-ee21ec7767621c1adb0a388e0e7d841674cdc43f.tar.xz |
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 <chris@chris-wilson.co.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200307093702.2269-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/drm_pci.c')
-rw-r--r-- | drivers/gpu/drm/drm_pci.c | 24 |
1 files changed, 12 insertions, 12 deletions
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) |