summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-01-02 04:01:44 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-01-02 04:01:44 +0000
commit6637a592a89ad41c6cfbf9b333a22656bebc5ada (patch)
tree194465ec7ee4a7c80f1d519ec7eee3dd9d23d92e
parent49b046c7c5bdb288acafc39dca8762e928c75449 (diff)
use pci_matchbyid.
-rw-r--r--sys/dev/pci/amdpm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c
index dc77a452902..2cbb9760f5e 100644
--- a/sys/dev/pci/amdpm.c
+++ b/sys/dev/pci/amdpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdpm.c,v 1.5 2004/09/17 10:18:01 grange Exp $ */
+/* $OpenBSD: amdpm.c,v 1.6 2006/01/02 04:01:43 brad Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -104,16 +104,16 @@ struct cfdriver amdpm_cd = {
#define AMDPM_RNDCNT_INCR(ev) /* nothing */
#endif
+const struct pci_matchid amdpm_ids[] = {
+ { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_766_PMC },
+ { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PBC768_PMC },
+};
+
int
amdpm_match(struct device *parent, void *match, void *aux)
{
- struct pci_attach_args *pa = aux;
-
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD &&
- (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_PBC768_PMC ||
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_766_PMC))
- return (1);
- return (0);
+ return (pci_matchbyid(aux, amdpm_ids,
+ sizeof(amdpm_ids) / sizeof(amdpm_ids[0])));
}
void