summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_subr.c
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/dev/usb/usb_subr.c
parent3640d8fbc3c96acfa3c60797f5d4037803d6177c (diff)
Merge usb_devinfo* helper functions into usbd_print(), nothing else use
them. ok ratchov@, mglocker@
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
-rw-r--r--sys/dev/usb/usb_subr.c25
1 files changed, 5 insertions, 20 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);
}