diff options
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 96f416afc3f6..3ab1e9cc4692 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -266,11 +266,19 @@ int drm_init(struct drm_driver *driver) | |||
266 | for (i = 0; driver->pci_driver.id_table[i].vendor != 0; i++) { | 266 | for (i = 0; driver->pci_driver.id_table[i].vendor != 0; i++) { |
267 | pid = (struct pci_device_id *)&driver->pci_driver.id_table[i]; | 267 | pid = (struct pci_device_id *)&driver->pci_driver.id_table[i]; |
268 | 268 | ||
269 | /* Loop around setting up a DRM device for each PCI device | ||
270 | * matching our ID and device class. If we had the internal | ||
271 | * function that pci_get_subsys and pci_get_class used, we'd | ||
272 | * be able to just pass pid in instead of doing a two-stage | ||
273 | * thing. | ||
274 | */ | ||
269 | pdev = NULL; | 275 | pdev = NULL; |
270 | /* pass back in pdev to account for multiple identical cards */ | ||
271 | while ((pdev = | 276 | while ((pdev = |
272 | pci_get_subsys(pid->vendor, pid->device, pid->subvendor, | 277 | pci_get_subsys(pid->vendor, pid->device, pid->subvendor, |
273 | pid->subdevice, pdev)) != NULL) { | 278 | pid->subdevice, pdev)) != NULL) { |
279 | if ((pdev->class & pid->class_mask) != pid->class) | ||
280 | continue; | ||
281 | |||
274 | /* stealth mode requires a manual probe */ | 282 | /* stealth mode requires a manual probe */ |
275 | pci_dev_get(pdev); | 283 | pci_dev_get(pdev); |
276 | drm_get_dev(pdev, pid, driver); | 284 | drm_get_dev(pdev, pid, driver); |