summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_url.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-11-06 12:58:01 +0000
committermpi <mpi@openbsd.org>2016-11-06 12:58:01 +0000
commitf4b7d08e232976fb177608012240d131217a6102 (patch)
treeaff6e90cb18c7ac218cb32f6dabc1967faff840c /sys/dev/usb/if_url.c
parentRemove unused fields from ffs_opt_t. (diff)
downloadwireguard-openbsd-f4b7d08e232976fb177608012240d131217a6102.tar.xz
wireguard-openbsd-f4b7d08e232976fb177608012240d131217a6102.zip
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_url.c')
-rw-r--r--sys/dev/usb/if_url.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index 31fe48286a3..13478c8b544 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_url.c,v 1.80 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_url.c,v 1.81 2016/11/06 12:58:01 mpi Exp $ */
/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -163,7 +163,7 @@ url_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != URL_CONFIG_NO)
return (UMATCH_NONE);
return (url_lookup(uaa->vendor, uaa->product) != NULL ?
@@ -188,13 +188,6 @@ url_attach(struct device *parent, struct device *self, void *aux)
sc->sc_udev = dev;
- /* Move the device into the configured state. */
- err = usbd_set_config_no(dev, URL_CONFIG_NO, 1);
- if (err) {
- printf("%s: setting config no failed\n", devname);
- goto bad;
- }
-
usb_init_task(&sc->sc_tick_task, url_tick_task, sc,
USB_TASK_TYPE_GENERIC);
rw_init(&sc->sc_mii_lock, "urlmii");