drm: call driver load after initing agp subsystem
authorDave Airlie <airlied@redhat.com>
Wed, 31 Oct 2007 00:21:05 +0000 (11:21 +1100)
committerDave Airlie <airlied@redhat.com>
Wed, 31 Oct 2007 00:21:05 +0000 (11:21 +1100)
linux-core/drm_stub.c

index 1d88d3755f179e42322573c547b2e472a329ffee..dabd174b2ad867318cac51c4b69a078eab42bf9f 100644 (file)
@@ -111,10 +111,6 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
 
        dev->driver = driver;
 
-       if (dev->driver->load)
-               if ((retcode = dev->driver->load(dev, ent->driver_data)))
-                       goto error_out_unreg;
-
        if (drm_core_has_AGP(dev)) {
                if (drm_device_is_agp(dev))
                        dev->agp = drm_agp_init(dev);
@@ -134,6 +130,11 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
                }
        }
 
+       if (dev->driver->load)
+               if ((retcode = dev->driver->load(dev, ent->driver_data)))
+                       goto error_out_unreg;
+
+
        retcode = drm_ctxbitmap_init(dev);
        if (retcode) {
                DRM_ERROR("Cannot allocate memory for context bitmap.\n");