Skip to contentSkip to conversation

drm/i915: check intel-agp module only for real intel graphics device

PATCH New Zhenyu Wang 1 participant 1 message Jul 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: check intel-agp module only for real intel graphics device

Move intel-agp module dependence check into device probe function instead of always checking that when loading i915 module, which seems too chatty on non-intel graphics device.

---
 drivers/gpu/drm/i915/i915_drv.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +5 -5
index eb91e2d..b802eb1 100644
@@ -652,6 +652,11 @@ int i915_reset(struct drm_device *dev, u8 flags)
 static int __devinit
 i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
+	if (!intel_agp_enabled) {
+		DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
+		return -ENODEV;
+	}
+
 	/* Only bind to function 0 of the device. Early generations
 	 * used function 1 as a placeholder for multi-head. This causes
 	 * us confusion instead, especially on the systems where both
@@ -813,11 +818,6 @@ static struct pci_driver i915_pci_driver = {
 
 static int __init i915_init(void)
 {
-	if (!intel_agp_enabled) {
-		DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
-		return -ENODEV;
-	}
-
 	driver.num_ioctls = i915_max_ioctl;
 
 	/*
Signature · 1 line
1.7.4.1