summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-02-14 03:26:52 +0000
committerEric Anholt <anholt@freebsd.org>2005-02-14 03:26:52 +0000
commited082798f481b43d9745aaae15306e94a9acb169 (patch)
treeee636fc01a24e7b76d9e9ae100efc7844c2bb8ba
parent2f7cd38c122b2f7f790e51b78a51cc935c9b2f18 (diff)
Use the proper API to get PCI vendor/device number for a dev.
PR: ports/76879 Submitted by: Alex, lesha at intercaf dot ru.
-rw-r--r--bsd-core/drm_drv.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index 102045c7..da86406c 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -140,17 +140,11 @@ static struct cdevsw drm_cdevsw = {
int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
{
const char *s = NULL;
- int pciid, vendor, device;
+ int vendor, device;
- /* XXX: Cope with agp bridge device? */
- if (!strcmp(device_get_name(dev), "drmsub"))
- pciid = pci_get_devid(device_get_parent(dev));
- else
- pciid = pci_get_devid(dev);
+ vendor = pci_get_vendor(dev);
+ device = pci_get_device(dev);
- vendor = (pciid & 0x0000ffff);
- device = (pciid & 0xffff0000) >> 16;
-
s = drm_find_description(vendor, device, idlist);
if (s != NULL) {
device_set_desc(dev, s);