diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2007-10-02 21:54:37 +0200 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2007-10-04 09:24:48 +0200 |
commit | 5ca12104f8a3eebecae6d238c1c456c8e6540ae3 (patch) | |
tree | ddfae6217a5acf7b9db119a5956a8602d33a0b64 /linux-core | |
parent | 7fbd10d93310345164d1e65da281848b05493797 (diff) |
linux-drm: Obey device class requirements when detecting devices.
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_drv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 73598892..a09fa96e 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -321,6 +321,11 @@ int drm_init(struct drm_driver *driver, while ((pdev = pci_get_subsys(pid->vendor, pid->device, pid->subvendor, pid->subdevice, pdev))) { + /* Are there device class requirements? */ + if ((pid->class != 0) + && ((pdev->class & pid->class_mask) != pid->class)) { + continue; + } /* is there already a driver loaded, or (short circuit saves work) */ /* does something like VesaFB have control of the memory region? */ if (pci_dev_driver(pdev) @@ -347,6 +352,11 @@ int drm_init(struct drm_driver *driver, pci_get_subsys(pid->vendor, pid->device, pid->subvendor, pid->subdevice, pdev))) { + /* Are there device class requirements? */ + if ((pid->class != 0) + && ((pdev->class & pid->class_mask) != pid->class)) { + continue; + } /* stealth mode requires a manual probe */ pci_dev_get(pdev); if ((rc = drm_get_dev(pdev, &pciidlist[i], driver))) { |