summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_uath.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-06 12:58:02 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-06 12:58:02 +0000
commit6eeb72ef4d657c28b7dd544e0c3f5b4651f5dc2b (patch)
tree4bb2419baa6f5f1486fa4b6962e05f3f945b75e9 /sys/dev/usb/if_uath.c
parentec6542fb7881ba68a65ceed9919c89afe7d5529a (diff)
Avoid calling usbd_set_config_no() in *_attach() and let the stack do
it instead. If anything bad happen due to a malformed descriptor it makes no sense to try to attach a driver, and bail before probing. This is similar to the change to avoid calling usbd_set_config_index().
Diffstat (limited to 'sys/dev/usb/if_uath.c')
-rw-r--r--sys/dev/usb/if_uath.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c
index 3fb3abe3c17..3d0d95465f3 100644
--- a/sys/dev/usb/if_uath.c
+++ b/sys/dev/usb/if_uath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_uath.c,v 1.77 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_uath.c,v 1.78 2016/11/06 12:58:01 mpi Exp $ */
/*-
* Copyright (c) 2006
@@ -191,7 +191,7 @@ uath_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UATH_CONFIG_NO)
return UMATCH_NONE;
return (uath_lookup(uaa->vendor, uaa->product) != NULL) ?
@@ -245,12 +245,6 @@ uath_attach(struct device *parent, struct device *self, void *aux)
sc->sc_flags = uath_lookup(uaa->vendor, uaa->product)->flags;
- if (usbd_set_config_no(sc->sc_udev, UATH_CONFIG_NO, 0) != 0) {
- printf("%s: could not set configuration no\n",
- sc->sc_dev.dv_xname);
- return;
- }
-
/* get the first interface handle */
error = usbd_device2interface_handle(sc->sc_udev, UATH_IFACE_INDEX,
&sc->sc_iface);