summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-10 17:46:28 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-10 17:46:28 +0000
commit6d81e40a10cdca42ea68ce7111a2caaa60f7f185 (patch)
tree56c000163fa0fe63df31ea1445f2f97eb62fbbc0 /sys
parenteca662797b306fe6394bf09e596f4184f133c3d5 (diff)
Get rid of the USBDEVPTRNAME macro.
No binary change. ok jsg.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/usb.c4
-rw-r--r--sys/dev/usb/usb_port.h3
-rw-r--r--sys/dev/usb/usb_subr.c12
-rw-r--r--sys/dev/usb/usbdi_util.c10
4 files changed, 14 insertions, 15 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 8d67cbf4dab..ba562e5d241 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.47 2007/06/10 15:33:16 mbalmer Exp $ */
+/* $OpenBSD: usb.c,v 1.48 2007/06/10 17:46:27 mbalmer Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -721,7 +721,7 @@ usbd_add_drv_event(int type, usbd_device_handle udev, device_ptr_t dev)
struct usb_event ue;
ue.u.ue_driver.ue_cookie = udev->cookie;
- strncpy(ue.u.ue_driver.ue_devname, USBDEVPTRNAME(dev),
+ strncpy(ue.u.ue_driver.ue_devname, dev->dv_xname,
sizeof ue.u.ue_driver.ue_devname);
usb_add_event(type, &ue);
}
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 63bacadf693..aa946e4aeed 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_port.h,v 1.78 2007/06/10 15:33:16 mbalmer Exp $ */
+/* $OpenBSD: usb_port.h,v 1.79 2007/06/10 17:46:27 mbalmer Exp $ */
/* $NetBSD: usb_port.h,v 1.62 2003/02/15 18:33:30 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -85,7 +85,6 @@ typedef struct proc *usb_proc_ptr;
#define slinear16_to_ulinear8_be linear16_to_ulinear8_be
typedef struct device *device_ptr_t;
-#define USBDEVPTRNAME(bdevptr) ((bdevptr)->dv_xname)
#define USBGETSOFTC(d) ((void *)(d))
#define DECLARE_USB_DMA_T \
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 5c220c5091f..85d446f9636 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.53 2007/06/10 15:33:16 mbalmer Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.54 2007/06/10 17:46:27 mbalmer 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 $ */
@@ -867,11 +867,11 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev, int port,
if (err) {
#ifdef USB_DEBUG
DPRINTF(("%s: port %d, set config at addr %d failed, "
- "error=%s\n", USBDEVPTRNAME(parent), port,
+ "error=%s\n", parent->dv_xname, port,
addr, usbd_errstr(err)));
#else
printf("%s: port %d, set config at addr %d failed\n",
- USBDEVPTRNAME(parent), port, addr);
+ parent->dv_xname, port, addr);
#endif
return (err);
@@ -1263,7 +1263,7 @@ usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di,
if (dev->subdevs != NULL) {
for (i = 0; dev->subdevs[i] && i < USB_MAX_DEVNAMES; i++) {
strncpy(di->udi_devnames[i],
- USBDEVPTRNAME(dev->subdevs[i]), USB_MAX_DEVNAMELEN);
+ dev->subdevs[i]->dv_xname, USB_MAX_DEVNAMELEN);
di->udi_devnames[i][USB_MAX_DEVNAMELEN-1] = '\0';
}
} else
@@ -1338,7 +1338,7 @@ void
usb_disconnect_port(struct usbd_port *up, device_ptr_t parent)
{
usbd_device_handle dev = up->device;
- char *hubname = USBDEVPTRNAME(parent);
+ char *hubname = parent->dv_xname;
int i;
DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
@@ -1354,7 +1354,7 @@ usb_disconnect_port(struct usbd_port *up, device_ptr_t parent)
if (dev->subdevs != NULL) {
DPRINTFN(3,("usb_disconnect_port: disconnect subdevs\n"));
for (i = 0; dev->subdevs[i]; i++) {
- printf("%s: at %s", USBDEVPTRNAME(dev->subdevs[i]),
+ printf("%s: at %s", dev->subdevs[i]->dv_xname,
hubname);
if (up->portno != 0)
printf(" port %d", up->portno);
diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c
index 5d2f4c3a2cf..6e578f65916 100644
--- a/sys/dev/usb/usbdi_util.c
+++ b/sys/dev/usb/usbdi_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi_util.c,v 1.21 2007/06/09 12:03:39 mbalmer Exp $ */
+/* $OpenBSD: usbdi_util.c,v 1.22 2007/06/10 17:46:27 mbalmer Exp $ */
/* $NetBSD: usbdi_util.c,v 1.40 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.c,v 1.14 1999/11/17 22:33:50 n_hibma Exp $ */
@@ -506,17 +506,17 @@ usbd_intr_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
void
usb_detach_wait(device_ptr_t dv)
{
- DPRINTF(("usb_detach_wait: waiting for %s\n", USBDEVPTRNAME(dv)));
+ DPRINTF(("usb_detach_wait: waiting for %s\n", dv->dv_xname));
if (tsleep(dv, PZERO, "usbdet", hz * 60))
printf("usb_detach_wait: %s didn't detach\n",
- USBDEVPTRNAME(dv));
- DPRINTF(("usb_detach_wait: %s done\n", USBDEVPTRNAME(dv)));
+ dv->dv_xname);
+ DPRINTF(("usb_detach_wait: %s done\n", dv->dv_xname));
}
void
usb_detach_wakeup(device_ptr_t dv)
{
- DPRINTF(("usb_detach_wakeup: for %s\n", USBDEVPTRNAME(dv)));
+ DPRINTF(("usb_detach_wakeup: for %s\n", dv->dv_xname));
wakeup(dv);
}