.set_busid = drm_pci_set_busid,
.set_unique = drm_pci_set_unique,
.irq_by_busid = drm_pci_irq_by_busid,
- .agp_init = drm_pci_agp_init,
.agp_destroy = drm_pci_agp_destroy,
};
if (drm_core_check_feature(dev, DRIVER_MODESET))
pci_set_drvdata(pdev, dev);
+ mutex_lock(&drm_global_mutex);
+ drm_pci_agp_init(dev);
+ mutex_unlock(&drm_global_mutex);
+
ret = drm_dev_register(dev, ent->driver_data);
if (ret)
- goto err_pci;
+ goto err_agp;
DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
driver->name, driver->major, driver->minor, driver->patchlevel,
return 0;
-err_pci:
+err_agp:
+ mutex_lock(&drm_global_mutex);
+ drm_pci_agp_destroy(dev);
+ mutex_unlock(&drm_global_mutex);
pci_disable_device(pdev);
err_free:
drm_dev_free(dev);
mutex_lock(&drm_global_mutex);
- if (dev->driver->bus->agp_init)
- dev->driver->bus->agp_init(dev);
-
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL);
if (ret)
- goto err_agp;
+ goto out_unlock;
}
if (drm_core_check_feature(dev, DRIVER_RENDER) && drm_rnodes) {
drm_put_minor(dev->render);
err_control_node:
drm_put_minor(dev->control);
-err_agp:
- if (dev->driver->bus->agp_destroy)
- dev->driver->bus->agp_destroy(dev);
out_unlock:
mutex_unlock(&drm_global_mutex);
return ret;
struct drm_unique *unique);
int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p);
/* hooks that are for PCI */
- void (*agp_init)(struct drm_device *dev);
void (*agp_destroy)(struct drm_device *dev);
};