Changeset 2b61945 in mainline for uspace/lib/usbhost/src/usb_transfer_batch.c
- Timestamp:
- 2017-10-22T03:47:41Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2e5aea1
- Parents:
- 766043c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_transfer_batch.c
r766043c r2b61945 40 40 #include <assert.h> 41 41 #include <errno.h> 42 #include <str_error.h> 42 43 43 44 … … 62 63 void usb_transfer_batch_init(usb_transfer_batch_t *batch, endpoint_t *ep) 63 64 { 65 endpoint_use(ep); 66 64 67 memset(batch, 0, sizeof(*batch)); 65 66 68 batch->ep = ep; 67 68 endpoint_use(ep);69 69 } 70 70 … … 103 103 assert(batch->ep->bus); 104 104 105 usb_log_debug2("batch %p " USB_TRANSFER_BATCH_FMT " disposing.\n",106 batch, USB_TRANSFER_BATCH_ARGS(*batch));107 108 105 bus_t *bus = batch->ep->bus; 109 if (bus->ops.destroy_batch) 106 if (bus->ops.destroy_batch) { 107 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " destroying.\n", 108 batch, USB_TRANSFER_BATCH_ARGS(*batch)); 110 109 bus->ops.destroy_batch(batch); 111 else 110 } 111 else { 112 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " disposing.\n", 113 batch, USB_TRANSFER_BATCH_ARGS(*batch)); 112 114 free(batch); 115 } 113 116 114 117 endpoint_release(batch->ep); … … 123 126 void usb_transfer_batch_finish(usb_transfer_batch_t *batch) 124 127 { 125 if (!batch_complete(batch)) 126 usb_log_warning("failed to complete batch %p!", batch); 128 const int err = batch_complete(batch); 129 if (err) 130 usb_log_warning("batch %p failed to complete: %s", batch, str_error(err)); 127 131 128 132 usb_transfer_batch_destroy(batch); … … 159 163 struct old_handler_wrapper_data *data = malloc(sizeof(*data)); 160 164 165 assert((!in_callback) != (!out_callback)); 166 161 167 data->in_callback = in_callback; 162 168 data->out_callback = out_callback;
Note:
See TracChangeset
for help on using the changeset viewer.