diff options
author | Martin Reindl <martin@cvs.openbsd.org> | 2007-11-03 10:09:04 +0000 |
---|---|---|
committer | Martin Reindl <martin@cvs.openbsd.org> | 2007-11-03 10:09:04 +0000 |
commit | 1ac724e5e11cf77297acd8d11373b5c0a09bb353 (patch) | |
tree | 57a31f7d3dcd1a68f0bb5e9ee70e809beaf221b0 /sys | |
parent | b80530fe36ff8aa2cfe7cd2f5eb8827c0308af85 (diff) |
use DEVICE_IS_VGA_PCI in vga_pci_match()
ok brad@ fgsch@ also tested by oga@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/pci/pci_machdep.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/vga_pci.c | 18 | ||||
-rw-r--r-- | sys/dev/pci/vga_pcivar.h | 4 |
3 files changed, 6 insertions, 20 deletions
diff --git a/sys/arch/alpha/pci/pci_machdep.c b/sys/arch/alpha/pci/pci_machdep.c index 1ee73b71cab..60d316dd931 100644 --- a/sys/arch/alpha/pci/pci_machdep.c +++ b/sys/arch/alpha/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.16 2002/03/14 01:26:27 millert Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.17 2007/11/03 10:09:03 martin Exp $ */ /* $NetBSD: pci_machdep.c,v 1.7 1996/11/19 04:57:32 cgd Exp $ */ /* @@ -85,7 +85,7 @@ pci_display_console(iot, memt, pc, bus, device, function) fn = NULL; #if NVGA_PCI - nmatch = DEVICE_IS_VGA_PCI(class, id); + nmatch = DEVICE_IS_VGA_PCI(class); if (nmatch > match) { match = nmatch; fn = vga_pci_cnattach; diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index bcc426dc89f..fc4c4507632 100644 --- a/sys/dev/pci/vga_pci.c +++ b/sys/dev/pci/vga_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_pci.c,v 1.26 2007/01/28 20:28:50 gwk Exp $ */ +/* $OpenBSD: vga_pci.c,v 1.27 2007/11/03 10:09:03 martin Exp $ */ /* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */ /* @@ -110,22 +110,8 @@ int vga_pci_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; - int potential; - potential = 0; - - /* - * If it's prehistoric/vga or display/vga, we might match. - * For the console device, this is jut a sanity check. - */ - if (PCI_CLASS(pa->pa_class) == PCI_CLASS_PREHISTORIC && - PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_PREHISTORIC_VGA) - potential = 1; - if (PCI_CLASS(pa->pa_class) == PCI_CLASS_DISPLAY && - PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_DISPLAY_VGA) - potential = 1; - - if (!potential) + if (DEVICE_IS_VGA_PCI(pa->pa_class) == 0) return (0); /* check whether it is disabled by firmware */ diff --git a/sys/dev/pci/vga_pcivar.h b/sys/dev/pci/vga_pcivar.h index 288fd357dc8..493bbb227b0 100644 --- a/sys/dev/pci/vga_pcivar.h +++ b/sys/dev/pci/vga_pcivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_pcivar.h,v 1.7 2006/11/27 18:04:28 gwk Exp $ */ +/* $OpenBSD: vga_pcivar.h,v 1.8 2007/11/03 10:09:03 martin Exp $ */ /* $NetBSD: vga_pcivar.h,v 1.1 1998/03/22 15:16:19 drochner Exp $ */ /* @@ -31,7 +31,7 @@ #ifndef _PCI_VGA_PCIVAR_H_ #define _PCI_VGA_PCIVAR_H_ -#define DEVICE_IS_VGA_PCI(class, id) \ +#define DEVICE_IS_VGA_PCI(class) \ (((PCI_CLASS(class) == PCI_CLASS_DISPLAY && \ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_VGA) || \ (PCI_CLASS(class) == PCI_CLASS_PREHISTORIC && \ |