OSDN Git Service

enable the device in the right order, remove __devinit from drm_int
authorJon Smirl <jonsmirl@yahoo.com>
Tue, 5 Oct 2004 02:58:14 +0000 (02:58 +0000)
committerJon Smirl <jonsmirl@yahoo.com>
Tue, 5 Oct 2004 02:58:14 +0000 (02:58 +0000)
linux-core/drm_drv.c
linux-core/drm_stub.c

index 3cc8da0..81ec1c7 100644 (file)
@@ -318,7 +318,7 @@ MODULE_PARM(drm_opts, "s");
  * 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)
 {
index 6f4753d..ed4cd19 100644 (file)
@@ -166,8 +166,13 @@ int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
                                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;
@@ -179,11 +184,6 @@ int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
                                       "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),
@@ -202,16 +202,16 @@ int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
        }
        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;
 }