Skip to content

Commit

Permalink
drm: reorganise start and load.
Browse files Browse the repository at this point in the history
Make sure we have the primary node so the device can add maps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Dec 29, 2008
1 parent 1147c9c commit a9d51a5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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",
Expand All @@ -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:
Expand Down

0 comments on commit a9d51a5

Please sign in to comment.