From 5ca12104f8a3eebecae6d238c1c456c8e6540ae3 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Tue, 2 Oct 2007 21:54:37 +0200 Subject: linux-drm: Obey device class requirements when detecting devices. --- linux-core/drm_drv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'linux-core') 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))) { -- cgit v1.2.3