summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-04-10 07:39:44 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-04-10 07:39:44 +0000
commitda1d01971c74a356c63cb775a4ff05ce55397900 (patch)
tree7837258cffbe31cbd15fa3411edfb4f42ba1fff0 /sys
parent3640d8fbc3c96acfa3c60797f5d4037803d6177c (diff)
Merge usb_devinfo* helper functions into usbd_print(), nothing else use
them. ok ratchov@, mglocker@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/usb_subr.c25
-rw-r--r--sys/dev/usb/usbdi.h5
2 files changed, 6 insertions, 24 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index b4eca5a270b..ee4018527bd 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.86 2013/04/09 08:42:48 mpi Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.87 2013/04/10 07:39:43 mpi Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -314,22 +314,6 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *base, size_t len)
snprintf(cp, base + len - cp, " addr %d", dev->address);
}
-char *
-usbd_devinfo_alloc(usbd_device_handle dev, int showclass)
-{
- char *devinfop;
-
- devinfop = malloc(DEVINFOSIZE, M_TEMP, M_WAITOK);
- usbd_devinfo(dev, showclass, devinfop, DEVINFOSIZE);
- return devinfop;
-}
-
-void
-usbd_devinfo_free(char *devinfop)
-{
- free(devinfop, M_TEMP);
-}
-
/* Delay for a certain number of ms */
void
usb_delay_ms(usbd_bus_handle bus, u_int ms)
@@ -1261,12 +1245,13 @@ usbd_print(void *aux, const char *pnp)
struct usb_attach_arg *uaa = aux;
char *devinfop;
- devinfop = usbd_devinfo_alloc(uaa->device, 0);
+ devinfop = malloc(DEVINFOSIZE, M_TEMP, M_WAITOK);
+ usbd_devinfo(uaa->device, 0, devinfop, DEVINFOSIZE);
DPRINTFN(15, ("usbd_print dev=%p\n", uaa->device));
if (pnp) {
if (!uaa->usegeneric) {
- usbd_devinfo_free(devinfop);
+ free(devinfop, M_TEMP);
return (QUIET);
}
printf("%s at %s", devinfop, pnp);
@@ -1280,7 +1265,7 @@ usbd_print(void *aux, const char *pnp)
if (!pnp)
printf(" %s\n", devinfop);
- usbd_devinfo_free(devinfop);
+ free(devinfop, M_TEMP);
return (UNCONF);
}
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 836c1ca4cf0..a6e83252fca 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.h,v 1.45 2013/04/09 08:47:56 mpi Exp $ */
+/* $OpenBSD: usbdi.h,v 1.46 2013/04/10 07:39:43 mpi Exp $ */
/* $NetBSD: usbdi.h,v 1.62 2002/07/11 21:14:35 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -152,9 +152,6 @@ void usbd_set_polling(usbd_device_handle iface, int on);
const char *usbd_errstr(usbd_status err);
-char *usbd_devinfo_alloc(usbd_device_handle dev, int showclass);
-void usbd_devinfo_free(char *devinfop);
-
const struct usbd_quirks *usbd_get_quirks(usbd_device_handle);
usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor(
usbd_interface_handle iface, u_int8_t address);