diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-05-03 23:19:32 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-05-03 23:19:32 +0000 |
commit | d8fc93d6e0056d6e6766bd78755f0ae46a9df77a (patch) | |
tree | dc7bd4664a2f12347660b3522b802445d27a2fed /sys | |
parent | 9184cf28416ac58b2c715265e70c2bcaad7fb758 (diff) | |
download | FreeBSD-src-d8fc93d6e0056d6e6766bd78755f0ae46a9df77a.zip FreeBSD-src-d8fc93d6e0056d6e6766bd78755f0ae46a9df77a.tar.gz |
Replace UE_GET_IN with UE_GET_DIR
Remove freeind of description. Is done by subr_bus.c.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 9154388..41cd471 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -224,11 +224,11 @@ USB_ATTACH(umass) USBDEVNAME(sc->sc_dev)); USB_ATTACH_ERROR_RETURN; } - if (UE_GET_IN(ed->bEndpointAddress) && - ((ed->bmAttributes & UE_XFERTYPE) == UE_BULK)) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_IN + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { sc->sc_bulkin = ed->bEndpointAddress; - } else if (!UE_GET_IN(ed->bEndpointAddress) && - ((ed->bmAttributes & UE_XFERTYPE) == UE_BULK)) { + } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_OUT + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { sc->sc_bulkout = ed->bEndpointAddress; } } @@ -266,9 +266,8 @@ static int umass_detach(device_t self) { umass_softc_t *sc = device_get_softc(self); - const char *devinfo = device_get_desc(sc->sc_dev); - DPRINTF(UDMASS_USB, ("%s: disconnected\n", USBDEVNAME(sc->sc_dev))); + DPRINTF(UDMASS_USB, ("%s: detached\n", USBDEVNAME(sc->sc_dev))); /* detach from the SCSI host controller (completely) */ umass_cam_detach(sc); @@ -279,10 +278,7 @@ umass_detach(device_t self) if (sc->sc_bulkin_pipe) usbd_close_pipe(sc->sc_bulkin_pipe); - if (devinfo) { - device_set_desc(sc->sc_dev, NULL); - free((void *)devinfo, M_USB); - } + device_set_desc(sc->sc_dev, NULL); return(0); } @@ -312,11 +308,10 @@ umass_usb_transfer(usbd_interface_handle iface, usbd_pipe_handle pipe, * transfer and then wait for it to complete */ - /* XXX we should not fetch a new request buffer for every transfer */ reqh = usbd_alloc_request(); if (!reqh) { - DPRINTF(UDMASS_USB, ("cannot allocate memory\n")); - return(USBD_NOMEM); + DPRINTF(UDMASS_USB, ("Not enough memory\n")); + return USBD_NOMEM; } (void) usbd_setup_request(reqh, pipe, 0, buf, buflen, @@ -330,11 +325,11 @@ umass_usb_transfer(usbd_interface_handle iface, usbd_pipe_handle pipe, } usbd_get_request_status(reqh, &priv, &buffer, &size, &err); - usbd_free_request(reqh); if (xfer_size) *xfer_size = size; + usbd_free_request(reqh); return(USBD_NORMAL_COMPLETION); } |