summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uipaq.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-10-11 18:33:13 +0000
committerderaadt <deraadt@openbsd.org>2007-10-11 18:33:13 +0000
commitfc5c6ac59ce5cbc022c1e83b8d45d511803eefc6 (patch)
treef48ba3f4f889ca73be80167ebfdbf26cc87597d9 /sys/dev/usb/uipaq.c
parentserialize usbd_probe_and_attach(); only let one usb device be match'd and (diff)
downloadwireguard-openbsd-fc5c6ac59ce5cbc022c1e83b8d45d511803eefc6.tar.xz
wireguard-openbsd-fc5c6ac59ce5cbc022c1e83b8d45d511803eefc6.zip
treat usb vendor/product names as a locator, and have usbd_print handle it,
so that it shows up before the :. as a result, all the usb devices do not need to have name printing code anymore. all this now works and prints nicely because usbd_probe_and_attach() is serialized. ok kettenis
Diffstat (limited to 'sys/dev/usb/uipaq.c')
-rw-r--r--sys/dev/usb/uipaq.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c
index 0bde75186f2..75de1cf0ed6 100644
--- a/sys/dev/usb/uipaq.c
+++ b/sys/dev/usb/uipaq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipaq.c,v 1.13 2007/09/02 04:20:25 jsg Exp $ */
+/* $OpenBSD: uipaq.c,v 1.14 2007/10/11 18:33:15 deraadt Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -172,7 +172,6 @@ uipaq_attach(struct device *parent, struct device *self, void *aux)
usbd_interface_handle iface;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
- char *devinfop;
char *devname = sc->sc_dev.dv_xname;
int i;
usbd_status err;
@@ -183,22 +182,18 @@ uipaq_attach(struct device *parent, struct device *self, void *aux)
/* Move the device into the configured state. */
err = usbd_set_config_no(dev, UIPAQ_CONFIG_NO, 1);
if (err) {
- printf("\n%s: failed to set configuration, err=%s\n",
- devname, usbd_errstr(err));
+ printf(": failed to set configuration, err=%s\n",
+ usbd_errstr(err));
goto bad;
}
err = usbd_device2interface_handle(dev, UIPAQ_IFACE_INDEX, &iface);
if (err) {
- printf("\n%s: failed to get interface, err=%s\n",
- devname, usbd_errstr(err));
+ printf(": failed to get interface, err=%s\n",
+ usbd_errstr(err));
goto bad;
}
- devinfop = usbd_devinfo_alloc(dev, 0);
- printf("\n%s: %s\n", devname, devinfop);
- usbd_devinfo_free(devinfop);
-
sc->sc_flags = uipaq_lookup(uaa->vendor, uaa->product)->uv_flags;
id = usbd_get_interface_descriptor(iface);