diff options
author | Martin Reindl <martin@cvs.openbsd.org> | 2007-11-05 19:24:32 +0000 |
---|---|---|
committer | Martin Reindl <martin@cvs.openbsd.org> | 2007-11-05 19:24:32 +0000 |
commit | 99e42e466648b88d5b8e12fffc61a4f43f3446a1 (patch) | |
tree | 9afc37f1486fe8a2fb12982f3954f0ead6f12ea6 /sys/arch/macppc | |
parent | 8165b425234ec3877e794381a9dece431c47f782 (diff) |
fix and use DEVICE_IS_VGA_PCI, makes vgafb_pci_match() much simpler
ok oga@ brad@
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r-- | sys/arch/macppc/pci/vgafb_pci.c | 24 | ||||
-rw-r--r-- | sys/arch/macppc/pci/vgafb_pcivar.h | 6 |
2 files changed, 5 insertions, 25 deletions
diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c index 2da962e1538..97c05b31fd3 100644 --- a/sys/arch/macppc/pci/vgafb_pci.c +++ b/sys/arch/macppc/pci/vgafb_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb_pci.c,v 1.18 2006/12/17 22:18:14 miod Exp $ */ +/* $OpenBSD: vgafb_pci.c,v 1.19 2007/11/05 19:24:31 martin Exp $ */ /* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */ /* @@ -229,29 +229,9 @@ vgafb_pci_match(parent, match, aux) void *aux; { struct pci_attach_args *pa = aux; - int potential; static int id = 0; - int myid; - - myid = id; - 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 (PCI_CLASS(pa->pa_class) == PCI_CLASS_DISPLAY && - PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_DISPLAY_MISC) - potential = 1; - - if (!potential) + if (DEVICE_IS_VGA_PCI(pa->pa_class) == 0) return (0); /* If it's the console, we have a winner! */ diff --git a/sys/arch/macppc/pci/vgafb_pcivar.h b/sys/arch/macppc/pci/vgafb_pcivar.h index 6e224390448..0633a331dbb 100644 --- a/sys/arch/macppc/pci/vgafb_pcivar.h +++ b/sys/arch/macppc/pci/vgafb_pcivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb_pcivar.h,v 1.4 2002/09/15 09:01:59 deraadt Exp $ */ +/* $OpenBSD: vgafb_pcivar.h,v 1.5 2007/11/05 19:24:31 martin Exp $ */ /* $NetBSD: vga_pcivar.h,v 1.1 1996/11/19 04:38:36 cgd Exp $ */ /* @@ -28,10 +28,10 @@ * rights to redistribute these changes. */ -#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_DISPLAY && \ + (PCI_CLASS(class) == PCI_CLASS_DISPLAY && \ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_MISC) || \ (PCI_CLASS(class) == PCI_CLASS_PREHISTORIC && \ PCI_SUBCLASS(class) == PCI_SUBCLASS_PREHISTORIC_VGA)) ? 1 : 0) |