]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/gpu/drm/drm_drv.c
Merge branch 'fix/asoc' into for-linus
[linux-2.6-omap-h63xx.git] / drivers / gpu / drm / drm_drv.c
index 96f416afc3f69b474fe685014573435600b85f4c..996097acb5e76b3c3d7698c0885f563ad9248522 100644 (file)
@@ -266,11 +266,19 @@ int drm_init(struct drm_driver *driver)
        for (i = 0; driver->pci_driver.id_table[i].vendor != 0; i++) {
                pid = (struct pci_device_id *)&driver->pci_driver.id_table[i];
 
+               /* Loop around setting up a DRM device for each PCI device
+                * matching our ID and device class.  If we had the internal
+                * function that pci_get_subsys and pci_get_class used, we'd
+                * be able to just pass pid in instead of doing a two-stage
+                * thing.
+                */
                pdev = NULL;
-               /* pass back in pdev to account for multiple identical cards */
                while ((pdev =
                        pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
                                       pid->subdevice, pdev)) != NULL) {
+                       if ((pdev->class & pid->class_mask) != pid->class)
+                               continue;
+
                        /* stealth mode requires a manual probe */
                        pci_dev_get(pdev);
                        drm_get_dev(pdev, pid, driver);
@@ -297,6 +305,8 @@ static void drm_cleanup(struct drm_device * dev)
                return;
        }
 
+       drm_vblank_cleanup(dev);
+
        drm_lastclose(dev);
 
        if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) &&