Ignore:
File:
1 edited

Legend:

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

    r0ede0c3 r2cc6e97  
    148148        assert(hc);
    149149        const size_t size = max_packet_size;
    150         int ret;
    151150        usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, address);
    152151        if (speed >= USB_SPEED_MAX) {
     
    157156            usb_str_speed(speed), direction, size, max_packet_size, interval);
    158157
    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;
     158        return usb_endpoint_manager_add_ep(&hc->ep_manager, address, endpoint,
     159            direction, transfer_type, speed, max_packet_size, size);
    175160}
    176161/*----------------------------------------------------------------------------*/
     
    210195        ret = hc_schedule(hc, batch);
    211196        if (ret != EOK) {
    212                 batch_dispose(batch);
     197                usb_transfer_batch_dispose(batch);
    213198        }
    214199        return ret;
     
    238223        ret = hc_schedule(hc, batch);
    239224        if (ret != EOK) {
    240                 batch_dispose(batch);
     225                usb_transfer_batch_dispose(batch);
    241226        }
    242227        return ret;
     
    266251        ret = hc_schedule(hc, batch);
    267252        if (ret != EOK) {
    268                 batch_dispose(batch);
     253                usb_transfer_batch_dispose(batch);
    269254        }
    270255        return ret;
     
    294279        ret = hc_schedule(hc, batch);
    295280        if (ret != EOK) {
    296                 batch_dispose(batch);
     281                usb_transfer_batch_dispose(batch);
    297282        }
    298283        return ret;
     
    327312        ret = hc_schedule(hc, batch);
    328313        if (ret != EOK) {
    329                 batch_dispose(batch);
     314                usb_transfer_batch_dispose(batch);
    330315        }
    331316        return ret;
     
    359344        ret = hc_schedule(hc, batch);
    360345        if (ret != EOK) {
    361                 batch_dispose(batch);
     346                usb_transfer_batch_dispose(batch);
    362347        }
    363348        return ret;
Note: See TracChangeset for help on using the changeset viewer.