Skip to content

Commit ee21ec7

Browse files
committed
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 <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 7e4f6fb commit ee21ec7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/gpu/drm/drm_pci.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,18 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
166166
return drm_pci_irq_by_busid(dev, p);
167167
}
168168

169+
void drm_pci_agp_destroy(struct drm_device *dev)
170+
{
171+
if (dev->agp) {
172+
arch_phys_wc_del(dev->agp->agp_mtrr);
173+
drm_legacy_agp_clear(dev);
174+
kfree(dev->agp);
175+
dev->agp = NULL;
176+
}
177+
}
178+
179+
#ifdef CONFIG_DRM_LEGACY
180+
169181
static void drm_pci_agp_init(struct drm_device *dev)
170182
{
171183
if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
@@ -180,18 +192,6 @@ static void drm_pci_agp_init(struct drm_device *dev)
180192
}
181193
}
182194

183-
void drm_pci_agp_destroy(struct drm_device *dev)
184-
{
185-
if (dev->agp) {
186-
arch_phys_wc_del(dev->agp->agp_mtrr);
187-
drm_legacy_agp_clear(dev);
188-
kfree(dev->agp);
189-
dev->agp = NULL;
190-
}
191-
}
192-
193-
#ifdef CONFIG_DRM_LEGACY
194-
195195
static int drm_get_pci_dev(struct pci_dev *pdev,
196196
const struct pci_device_id *ent,
197197
struct drm_driver *driver)

0 commit comments

Comments
 (0)