* Expands the \c DRIVER_PREINIT and \c DRIVER_POST_INIT macros before and
* after the initialization for driver customization.
*/
-int __devinit drm_init(struct pci_driver *driver,
+int drm_init(struct pci_driver *driver,
struct pci_device_id *pciidlist,
struct drm_driver_fn *driver_fn)
{
return -ENOMEM;
*minors = (drm_minor_t) {
- .dev = dev,.class = DRM_MINOR_PRIMARY};
+ .dev = dev,.class = DRM_MINOR_PRIMARY};
dev->minor = minor;
+ if (!drm_fb_loaded) {
+ pci_set_drvdata(pdev, dev);
+ pci_request_regions(pdev, DRIVER_NAME);
+ pci_enable_device(pdev);
+ }
if ((ret = fill_in_dev(dev, pdev, ent, driver_fn))) {
printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
goto err_g1;
"DRM: Failed to initialize /proc/dri.\n");
goto err_g1;
}
- if (!drm_fb_loaded) {
- pci_set_drvdata(pdev, dev);
- pci_request_regions(pdev, DRIVER_NAME);
- pci_enable_device(pdev);
- }
dev_class = drm_sysfs_device_add(drm_class,
MKDEV(DRM_MAJOR,
minor),
}
DRM_ERROR("out of minors\n");
return -ENOMEM;
- err_g2:
+err_g2:
+ drm_proc_cleanup(minor, drm_proc_root, minors->dev_root);
+err_g1:
if (!drm_fb_loaded) {
pci_set_drvdata(pdev, NULL);
pci_release_regions(pdev);
pci_disable_device(pdev);
}
- drm_proc_cleanup(minor, drm_proc_root, minors->dev_root);
- err_g1:
*minors = (drm_minor_t) {
- .dev = NULL,.class = DRM_MINOR_FREE};
+ .dev = NULL,.class = DRM_MINOR_FREE};
drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
return ret;
}