diff options
author | 2003-04-29 21:58:35 +0000 | |
---|---|---|
committer | 2003-04-29 21:58:35 +0000 | |
commit | 9e32f8b3d24ecc0ab948544ce837c97f97ccd5f4 (patch) | |
tree | 538671f866eb37f77ad44ed07712e3147bda7b16 | |
parent | grr... %s, not dc%s (diff) | |
download | wireguard-openbsd-9e32f8b3d24ecc0ab948544ce837c97f97ccd5f4.tar.xz wireguard-openbsd-9e32f8b3d24ecc0ab948544ce837c97f97ccd5f4.zip |
Use pci_matchbyid(). Tested by matthieu@
-rw-r--r-- | sys/dev/pci/tga.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c index ec72344eaf8..5b1b68ea55d 100644 --- a/sys/dev/pci/tga.c +++ b/sys/dev/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.19 2002/11/09 22:51:48 miod Exp $ */ +/* $OpenBSD: tga.c,v 1.20 2003/04/29 21:58:35 miod Exp $ */ /* $NetBSD: tga.c,v 1.40 2002/03/13 15:05:18 ad Exp $ */ /* @@ -173,24 +173,21 @@ int tgadebug = 0; #define DPRINTFN(n,...) #endif +const struct pci_matchid tga_devices[] = { + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21030 }, + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_PBXGB }, +}; + int tgamatch(parent, match, aux) struct device *parent; struct cfdata *match; void *aux; { - struct pci_attach_args *pa = aux; - - if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_DEC) - return (0); + if (pci_matchbyid((struct pci_attach_args *)aux, tga_devices, + sizeof(tga_devices) / sizeof(tga_devices[0]))) + return (10); /* need to return more than vga_pci here! */ - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_DEC_21030: - case PCI_PRODUCT_DEC_PBXGB: - return 10; - default: - return 0; - } return (0); } |