summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_otus.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_otus.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_otus.c')
-rw-r--r--sys/dev/usb/if_otus.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c
index 86e24086d4c..5b37a1ccb53 100644
--- a/sys/dev/usb/if_otus.c
+++ b/sys/dev/usb/if_otus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otus.c,v 1.53 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_otus.c,v 1.54 2016/11/06 12:58:01 mpi Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -176,7 +176,7 @@ otus_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != 1)
return UMATCH_NONE;
return (usb_lookup(otus_devs, uaa->vendor, uaa->product) != NULL) ?
@@ -199,12 +199,6 @@ otus_attach(struct device *parent, struct device *self, void *aux)
sc->amrr.amrr_min_success_threshold = 1;
sc->amrr.amrr_max_success_threshold = 10;
- if (usbd_set_config_no(sc->sc_udev, 1, 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, 0, &sc->sc_iface);
if (error != 0) {