Changeset 70fb822 in mainline for uspace/lib/usbhost/src/iface.c


Ignore:
Timestamp:
2011-08-31T18:21:48Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f18d82f0
Parents:
ff6dd73
Message:

libusbhost: change usb_transfer_batch_T handling to get/dispose pair

libusbhost: release endpoint on batch dispose, to be consistent with acquire on get (and avoid deadlock on error path)
uhci: usb_transfer_batch_finish is no longer necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/iface.c

    rff6dd73 r70fb822  
    7171                return ENOSPC;
    7272        }
    73         usb_transfer_batch_t *batch = malloc(sizeof(usb_transfer_batch_t));
     73        if (!hcd->schedule) {
     74                usb_log_error("HCD does not implement scheduler.\n");
     75                return ENOTSUP;
     76        }
     77
     78        /* No private data and no private data dtor */
     79        usb_transfer_batch_t *batch =
     80            usb_transfer_batch_get(ep, data, NULL, size, setup_data,
     81                setup_size, in, out, arg, fun, NULL, NULL);
    7482        if (!batch) {
    75                 ret = ENOMEM;
    76                 goto out;
    77 
    78         }
    79 
    80         /* No private data and no private data dtor, these will be set later */
    81         usb_transfer_batch_init(batch, ep, data, NULL, size, setup_data,
    82             setup_size, in, out, arg, fun, NULL, NULL);
    83 
    84         if (hcd->schedule) {
    85                 ret = hcd->schedule(hcd, batch);
    86         } else {
    87                 usb_log_error("HCD does not implement scheduler.\n");
    88                 ret = ENOTSUP;
    89         }
    90 out:
     83                return ENOMEM;
     84        }
     85
     86        ret = hcd->schedule(hcd, batch);
    9187        if (ret != EOK)
    9288                usb_transfer_batch_dispose(batch);
Note: See TracChangeset for help on using the changeset viewer.