diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2010-12-17 21:53:35 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2010-12-17 21:53:35 +0000 |
commit | f90a2c56da97da2907278a6797235ca0f13bdfd5 (patch) | |
tree | 0e0b5048310d832aaf149cfcf84e69baf688c8c7 /sys/dev/usb | |
parent | d7cf17489beb3b4a1d7c64cce7bff5b0d21cb540 (diff) |
- use usb_lookup() instead of handrolled macro
ok jakemsr@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/ubsa.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/uchcom.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/udcf.c | 8 | ||||
-rw-r--r-- | sys/dev/usb/umct.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/urio.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/uvscom.c | 7 |
6 files changed, 18 insertions, 25 deletions
diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index 86d06c9904f..2d9e1d33c9a 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsa.c,v 1.50 2010/09/24 08:33:59 yuo Exp $ */ +/* $OpenBSD: ubsa.c,v 1.51 2010/12/17 21:53:34 jasper Exp $ */ /* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */ /*- * Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>. @@ -219,7 +219,6 @@ const struct usb_devno ubsa_devs[] = { /* ZTE Inc. AC8700 */ { USB_VENDOR_ZTE, USB_PRODUCT_ZTE_AC8700 }, }; -#define ubsa_lookup(v, p) usb_lookup(ubsa_devs, v, p) int ubsa_match(struct device *, void *, void *); void ubsa_attach(struct device *, struct device *, void *); @@ -246,8 +245,8 @@ ubsa_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return (UMATCH_NONE); - return (ubsa_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(ubsa_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void diff --git a/sys/dev/usb/uchcom.c b/sys/dev/usb/uchcom.c index d1c51d2a2a0..dd4b564220c 100644 --- a/sys/dev/usb/uchcom.c +++ b/sys/dev/usb/uchcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uchcom.c,v 1.11 2010/09/24 08:33:59 yuo Exp $ */ +/* $OpenBSD: uchcom.c,v 1.12 2010/12/17 21:53:34 jasper Exp $ */ /* $NetBSD: uchcom.c,v 1.1 2007/09/03 17:57:37 tshiozak Exp $ */ /* @@ -225,7 +225,6 @@ static const struct usb_devno uchcom_devs[] = { { USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH340 }, { USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341A } }; -#define uchcom_lookup(v, p) usb_lookup(uchcom_devs, v, p) struct cfdriver uchcom_cd = { NULL, "uchcom", DV_DULL @@ -251,8 +250,8 @@ uchcom_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return UMATCH_NONE; - return (uchcom_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(uchcom_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c index 6ae19f8e996..03e556b9aa6 100644 --- a/sys/dev/usb/udcf.c +++ b/sys/dev/usb/udcf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udcf.c,v 1.51 2010/12/06 04:41:40 jakemsr Exp $ */ +/* $OpenBSD: udcf.c,v 1.52 2010/12/17 21:53:34 jasper Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Marc Balmer <mbalmer@openbsd.org> @@ -170,10 +170,8 @@ udcf_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return UMATCH_NONE; - if (usb_lookup(udcf_devs, uaa->vendor, uaa->product) == NULL) - return UMATCH_NONE; - - return UMATCH_VENDOR_PRODUCT; + return (usb_lookup(udcf_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index dc5f90db9d2..93395646620 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umct.c,v 1.30 2010/09/24 08:33:59 yuo Exp $ */ +/* $OpenBSD: umct.c,v 1.31 2010/12/17 21:53:34 jasper Exp $ */ /* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -147,7 +147,6 @@ static const struct usb_devno umct_devs[] = { /* BELKIN F5U409 */ { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U409 }, }; -#define umct_lookup(v, p) usb_lookup(umct_devs, v, p) int umct_match(struct device *, void *, void *); void umct_attach(struct device *, struct device *, void *); @@ -174,8 +173,8 @@ umct_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return (UMATCH_NONE); - return (umct_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(umct_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index acae4629506..39ff81b0488 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: urio.c,v 1.36 2010/09/24 08:33:59 yuo Exp $ */ +/* $OpenBSD: urio.c,v 1.37 2010/12/17 21:53:34 jasper Exp $ */ /* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */ /* @@ -94,7 +94,6 @@ static const struct usb_devno urio_devs[] = { { USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB}, { USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_PSAPLAY120}, }; -#define urio_lookup(v, p) usb_lookup(urio_devs, v, p) int urio_match(struct device *, void *, void *); void urio_attach(struct device *, struct device *, void *); @@ -123,8 +122,8 @@ urio_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return (UMATCH_NONE); - return (urio_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(urio_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index aab3928f12c..6b18fa63740 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvscom.c,v 1.21 2010/09/24 08:33:59 yuo Exp $ */ +/* $OpenBSD: uvscom.c,v 1.22 2010/12/17 21:53:34 jasper Exp $ */ /* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */ /*- * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>. @@ -205,7 +205,6 @@ static const struct usb_devno uvscom_devs [] = { /* SUNTAC Ir-Trinity */ { USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_IS96U }, }; -#define uvscom_lookup(v, p) usb_lookup(uvscom_devs, v, p) int uvscom_match(struct device *, void *, void *); void uvscom_attach(struct device *, struct device *, void *); @@ -232,8 +231,8 @@ uvscom_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return (UMATCH_NONE); - return (uvscom_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(uvscom_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void |