summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2013-06-10 00:49:27 +0000
committerBrad Smith <brad@cvs.openbsd.org>2013-06-10 00:49:27 +0000
commitc74204a5535b9b04aa22ccc3a94f829bfee249e3 (patch)
tree39c43bd4640dad7154b47da19846039b76b3ccb8 /sys/dev
parentc8aee3f8eca3a7d57d397dfa65f33e265ec49aa5 (diff)
Make use of pci_matchbyid().
ok yasuoka@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_vmx.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/pci/if_vmx.c b/sys/dev/pci/if_vmx.c
index 793a54c1ee7..7e25d22fc70 100644
--- a/sys/dev/pci/if_vmx.c
+++ b/sys/dev/pci/if_vmx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vmx.c,v 1.5 2013/06/08 17:07:31 brad Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.6 2013/06/10 00:49:26 brad Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
@@ -170,6 +170,10 @@ void vmxnet3_media_status(struct ifnet *, struct ifmediareq *);
int vmxnet3_media_change(struct ifnet *);
static void *dma_allocmem(struct vmxnet3_softc *, u_int, u_int, bus_addr_t *);
+const struct pci_matchid vmx_devices[] = {
+ { PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_NET_3 }
+};
+
struct cfattach vmx_ca = {
sizeof(struct vmxnet3_softc), vmxnet3_match, vmxnet3_attach
};
@@ -181,13 +185,7 @@ struct cfdriver vmx_cd = {
int
vmxnet3_match(struct device *parent, void *match, void *aux)
{
- struct pci_attach_args *pa = aux;
-
- switch (pa->pa_id) {
- case PCI_ID_CODE(PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_NET_3):
- return 1;
- }
- return 0;
+ return (pci_matchbyid(aux, vmx_devices, nitems(vmx_devices)));
}
void