summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_upl.c
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2010-12-17 13:48:07 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2010-12-17 13:48:07 +0000
commit99ced48cb99b859e75f45d4109466d8e90681de4 (patch)
treefcca16cd8c4dab6ff8213da3041c4fa75cbb8839 /sys/dev/usb/if_upl.c
parent91d35287430f58e51bdea4466b5a8ab045f7b257 (diff)
- use usb_lookup() instead of handrolled macro.
ok jakemsr@
Diffstat (limited to 'sys/dev/usb/if_upl.c')
-rw-r--r--sys/dev/usb/if_upl.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c
index 0c91e0773a1..4dd1d3f2391 100644
--- a/sys/dev/usb/if_upl.c
+++ b/sys/dev/usb/if_upl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upl.c,v 1.45 2010/12/06 05:46:17 jakemsr Exp $ */
+/* $OpenBSD: if_upl.c,v 1.46 2010/12/17 13:48:06 jasper Exp $ */
/* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -104,11 +104,6 @@
#define UPL_ENDPT_INTR 0x2
#define UPL_ENDPT_MAX 0x3
-struct upl_type {
- u_int16_t upl_vid;
- u_int16_t upl_did;
-};
-
struct upl_softc;
struct upl_chain {
@@ -163,10 +158,9 @@ int upldebug = 0;
/*
* Various supported device vendors/products.
*/
-struct upl_type sc_devs[] = {
+struct usb_devno upl_devs[] = {
{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301 },
- { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302 },
- { 0, 0 }
+ { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302 }
};
int upl_match(struct device *, void *, void *);
@@ -211,16 +205,12 @@ int
upl_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- struct upl_type *t;
if (uaa->iface != NULL)
return (UMATCH_NONE);
- for (t = sc_devs; t->upl_vid != 0; t++)
- if (uaa->vendor == t->upl_vid && uaa->product == t->upl_did)
- return (UMATCH_VENDOR_PRODUCT);
-
- return (UMATCH_NONE);
+ return (usb_lookup(upl_devs, uaa->vendor, uaa->product) != NULL ?
+ UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
}
void