diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2012-05-15 12:48:33 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2012-05-15 12:48:33 +0000 |
commit | 582c6b4a7078c360ee8575a8253ad694b9fc88dd (patch) | |
tree | 43d69e22c1cb059836540e50305f1da50a80ac93 /sys/dev/usb/usb.c | |
parent | ffb8d86ca30164c7e5a3ca85644f6c48487a73c8 (diff) |
Don't use a pointer to an opaque softc, we'll need to access its unit
number. No functional change.
ok miod@
Diffstat (limited to 'sys/dev/usb/usb.c')
-rw-r--r-- | sys/dev/usb/usb.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index d2d256fe750..2b45f895025 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.80 2012/05/12 17:27:44 mpi Exp $ */ +/* $OpenBSD: usb.c,v 1.81 2012/05/15 12:48:32 mpi Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -152,7 +152,7 @@ usb_attach(struct device *parent, struct device *self, void *aux) usbd_init(); sc->sc_bus = aux; - sc->sc_bus->usbctl = sc; + sc->sc_bus->usbctl = self; sc->sc_port.power = USB_MAX_POWER; usbrev = sc->sc_bus->usbrev; @@ -719,16 +719,17 @@ usb_explore(void *v) void usb_needs_explore(usbd_device_handle dev, int first_explore) { - DPRINTFN(3,("%s: %s\n", dev->bus->usbctl->sc_dev.dv_xname, __func__)); + struct usb_softc *usbctl = (struct usb_softc *)dev->bus->usbctl; - if (!first_explore && - (dev->bus->flags & USB_BUS_CONFIG_PENDING)) { + DPRINTFN(3,("%s: %s\n", usbctl->sc_dev.dv_xname, __func__)); + + if (!first_explore && (dev->bus->flags & USB_BUS_CONFIG_PENDING)) { DPRINTF(("%s: %s: not exploring before first explore\n", - __func__, dev->bus->usbctl->sc_dev.dv_xname)); + __func__, usbctl->sc_dev.dv_xname)); return; } - usb_add_task(dev, &dev->bus->usbctl->sc_explore_task); + usb_add_task(dev, &usbctl->sc_explore_task); } void |