aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2008-12-07 12:02:21 +1000
committerDave Airlie <airlied@linux.ie>2008-12-29 17:47:22 +1000
commita9d51a5ad1154b5b20add1e8d30a5564f8aabbe9 (patch)
tree10318d54dc1ab138f2a864c00feb30c619b1b208 /drivers/gpu
parent1147c9cdd0f60f09a98702a9f865176af18a989f (diff)
drm: reorganise start and load.
Make sure we have the primary node so the device can add maps. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_stub.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index f7985c303cb..ea7f9e5d47f 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -237,9 +237,6 @@ 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) {
@@ -368,6 +365,10 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
if ((ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY)))
goto err_g2;
+ if (dev->driver->load)
+ if ((ret = dev->driver->load(dev, ent->driver_data)))
+ goto err_g3;
+
list_add_tail(&dev->driver_item, &driver->device_list);
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
@@ -376,6 +377,8 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
return 0;
+err_g3:
+ drm_put_minor(&dev->primary);
err_g2:
pci_disable_device(pdev);
err_g1: