enable the device in the right order, remove __devinit from drm_int
parent
aba12cfc0e
commit
6dee8401a6
|
@ -318,7 +318,7 @@ MODULE_PARM(drm_opts, "s");
|
||||||
* Expands the \c DRIVER_PREINIT and \c DRIVER_POST_INIT macros before and
|
* Expands the \c DRIVER_PREINIT and \c DRIVER_POST_INIT macros before and
|
||||||
* after the initialization for driver customization.
|
* 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 pci_device_id *pciidlist,
|
||||||
struct drm_driver_fn *driver_fn)
|
struct drm_driver_fn *driver_fn)
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,8 +166,13 @@ int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
*minors = (drm_minor_t) {
|
*minors = (drm_minor_t) {
|
||||||
.dev = dev,.class = DRM_MINOR_PRIMARY};
|
.dev = dev,.class = DRM_MINOR_PRIMARY};
|
||||||
dev->minor = minor;
|
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))) {
|
if ((ret = fill_in_dev(dev, pdev, ent, driver_fn))) {
|
||||||
printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
|
printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
|
||||||
goto err_g1;
|
goto err_g1;
|
||||||
|
@ -179,11 +184,6 @@ int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
|
||||||
"DRM: Failed to initialize /proc/dri.\n");
|
"DRM: Failed to initialize /proc/dri.\n");
|
||||||
goto err_g1;
|
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,
|
dev_class = drm_sysfs_device_add(drm_class,
|
||||||
MKDEV(DRM_MAJOR,
|
MKDEV(DRM_MAJOR,
|
||||||
minor),
|
minor),
|
||||||
|
@ -202,16 +202,16 @@ int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
|
||||||
}
|
}
|
||||||
DRM_ERROR("out of minors\n");
|
DRM_ERROR("out of minors\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
err_g2:
|
err_g2:
|
||||||
|
drm_proc_cleanup(minor, drm_proc_root, minors->dev_root);
|
||||||
|
err_g1:
|
||||||
if (!drm_fb_loaded) {
|
if (!drm_fb_loaded) {
|
||||||
pci_set_drvdata(pdev, NULL);
|
pci_set_drvdata(pdev, NULL);
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
}
|
}
|
||||||
drm_proc_cleanup(minor, drm_proc_root, minors->dev_root);
|
|
||||||
err_g1:
|
|
||||||
*minors = (drm_minor_t) {
|
*minors = (drm_minor_t) {
|
||||||
.dev = NULL,.class = DRM_MINOR_FREE};
|
.dev = NULL,.class = DRM_MINOR_FREE};
|
||||||
drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
|
drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue