Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/iface.c

    r2cc6e97 r0ede0c3  
    148148        assert(hc);
    149149        const size_t size = max_packet_size;
     150        int ret;
    150151        usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, address);
    151152        if (speed >= USB_SPEED_MAX) {
     
    156157            usb_str_speed(speed), direction, size, max_packet_size, interval);
    157158
    158         return usb_endpoint_manager_add_ep(&hc->ep_manager, address, endpoint,
    159             direction, transfer_type, speed, max_packet_size, size);
     159
     160        endpoint_t *ep = malloc(sizeof(endpoint_t));
     161        if (ep == NULL)
     162                return ENOMEM;
     163        ret = endpoint_init(ep, address, endpoint, direction,
     164            transfer_type, speed, max_packet_size);
     165        if (ret != EOK) {
     166                free(ep);
     167                return ret;
     168        }
     169
     170        ret = usb_endpoint_manager_register_ep(&hc->ep_manager, ep, size);
     171        if (ret != EOK) {
     172                endpoint_destroy(ep);
     173        }
     174        return ret;
    160175}
    161176/*----------------------------------------------------------------------------*/
     
    195210        ret = hc_schedule(hc, batch);
    196211        if (ret != EOK) {
    197                 usb_transfer_batch_dispose(batch);
     212                batch_dispose(batch);
    198213        }
    199214        return ret;
     
    223238        ret = hc_schedule(hc, batch);
    224239        if (ret != EOK) {
    225                 usb_transfer_batch_dispose(batch);
     240                batch_dispose(batch);
    226241        }
    227242        return ret;
     
    251266        ret = hc_schedule(hc, batch);
    252267        if (ret != EOK) {
    253                 usb_transfer_batch_dispose(batch);
     268                batch_dispose(batch);
    254269        }
    255270        return ret;
     
    279294        ret = hc_schedule(hc, batch);
    280295        if (ret != EOK) {
    281                 usb_transfer_batch_dispose(batch);
     296                batch_dispose(batch);
    282297        }
    283298        return ret;
     
    312327        ret = hc_schedule(hc, batch);
    313328        if (ret != EOK) {
    314                 usb_transfer_batch_dispose(batch);
     329                batch_dispose(batch);
    315330        }
    316331        return ret;
     
    344359        ret = hc_schedule(hc, batch);
    345360        if (ret != EOK) {
    346                 usb_transfer_batch_dispose(batch);
     361                batch_dispose(batch);
    347362        }
    348363        return ret;
Note: See TracChangeset for help on using the changeset viewer.