agp/intel-gtt: don't require the agp bridge on setup
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 7 Jun 2012 13:55:58 +0000 (15:55 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 12 Jun 2012 20:18:54 +0000 (22:18 +0200)
We only need it to fake the agp interface and don't actually
use it in the driver anywhere. Hence conditionalize that.

This is just a prep patch to eventually disable the fake agp
driver on gen6+.

Reviewed-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/char/agp/intel-gtt.c

index 2aab0a03ee4226ffe5cad5029a553263ae240050..5e6c89e1d5ebced42ae4e95a9bef066c97455f90 100644 (file)
@@ -1539,9 +1539,11 @@ int intel_gmch_probe(struct pci_dev *pdev,
        if (!intel_private.driver)
                return 0;
 
-       bridge->driver = &intel_fake_agp_driver;
-       bridge->dev_private_data = &intel_private;
-       bridge->dev = pdev;
+       if (bridge) {
+               bridge->driver = &intel_fake_agp_driver;
+               bridge->dev_private_data = &intel_private;
+               bridge->dev = pdev;
+       }
 
        intel_private.bridge_dev = pci_dev_get(pdev);