Changeset 0f1586d0 in mainline


Ignore:
Timestamp:
2011-09-02T20:25:02Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
52eead3e
Parents:
5f57929
Message:

ohci: do not create OHCI hw structures for root hub control endpoint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hc.c

    r5f57929 r0f1586d0  
    139139            &instance->generic.dev_manager, hub_address, hub_fun->handle);
    140140
    141 #define CHECK_RET_DESTROY(ret, message...) \
     141#define CHECK_RET_RETURN(ret, message...) \
    142142if (ret != EOK) { \
    143143        usb_log_error(message); \
    144         endpoint_destroy(ep); \
    145         usb_endpoint_manager_unregister_ep(&instance->generic.ep_manager, \
    146             hub_address, 0, USB_DIRECTION_BOTH); \
    147144        return ret; \
    148145} else (void)0
    149         endpoint_t *ep =
    150             endpoint_get(hub_address, 0, USB_DIRECTION_BOTH,
    151             USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64);
    152         if (ep == NULL)
    153                 return ENOMEM;
    154 
    155         int ret = ohci_endpoint_init(&instance->generic, ep);
    156         CHECK_RET_DESTROY(ret, "Failed to initialize rh OHCI ep structures.\n");
    157 
    158         ret = usb_endpoint_manager_register_ep(
    159             &instance->generic.ep_manager, ep, 0);
    160         CHECK_RET_DESTROY(ret, "Failed to initialize rh control ep.\n");
    161         ep = NULL;
     146        int ret = usb_endpoint_manager_add_ep(
     147            &instance->generic.ep_manager, hub_address, 0, USB_DIRECTION_BOTH,
     148            USB_TRANSFER_CONTROL, USB_SPEED_FULL, 64, 0);
     149        CHECK_RET_RETURN(ret,
     150            "Failed to register root hub control endpoint: %s.\n",
     151            str_error(ret));
    162152
    163153        ret = ddf_fun_add_match_id(hub_fun, "usb&class=hub", 100);
    164         CHECK_RET_DESTROY(ret,
     154        CHECK_RET_RETURN(ret,
    165155            "Failed to add root hub match-id: %s.\n", str_error(ret));
    166156
    167157        ret = ddf_fun_bind(hub_fun);
    168         CHECK_RET_DESTROY(ret,
     158        CHECK_RET_RETURN(ret,
    169159            "Failed to bind root hub function: %s.\n", str_error(ret));
    170160
Note: See TracChangeset for help on using the changeset viewer.