Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/usbhub.c

    rb7fd2a0 r58563585  
    8181};
    8282
    83 static errno_t usb_set_first_configuration(usb_device_t *usb_device);
    84 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev);
     83static int usb_set_first_configuration(usb_device_t *usb_device);
     84static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev);
    8585static void usb_hub_over_current(const usb_hub_dev_t *hub_dev,
    8686    usb_hub_status_t status);
     
    9797 * @return error code
    9898 */
    99 errno_t usb_hub_device_add(usb_device_t *usb_dev)
     99int usb_hub_device_add(usb_device_t *usb_dev)
    100100{
    101101        assert(usb_dev);
     
    114114
    115115        /* Set hub's first configuration. (There should be only one) */
    116         errno_t opResult = usb_set_first_configuration(usb_dev);
     116        int opResult = usb_set_first_configuration(usb_dev);
    117117        if (opResult != EOK) {
    118118                usb_log_error("Could not set hub configuration: %s\n",
     
    174174 * @return error code
    175175 */
    176 errno_t usb_hub_device_remove(usb_device_t *usb_dev)
     176int usb_hub_device_remove(usb_device_t *usb_dev)
    177177{
    178178        return ENOTSUP;
     
    184184 * @return error code
    185185 */
    186 errno_t usb_hub_device_gone(usb_device_t *usb_dev)
     186int usb_hub_device_gone(usb_device_t *usb_dev)
    187187{
    188188        assert(usb_dev);
     
    202202
    203203        for (size_t port = 0; port < hub->port_count; ++port) {
    204                 const errno_t ret = usb_hub_port_fini(&hub->ports[port], hub);
     204                const int ret = usb_hub_port_fini(&hub->ports[port], hub);
    205205                if (ret != EOK)
    206206                        return ret;
     
    208208        free(hub->ports);
    209209
    210         const errno_t ret = ddf_fun_unbind(hub->hub_fun);
     210        const int ret = ddf_fun_unbind(hub->hub_fun);
    211211        if (ret != EOK) {
    212212                usb_log_error("(%p) Failed to unbind '%s' function: %s.",
     
    266266 * @return error code
    267267 */
    268 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)
     268static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)
    269269{
    270270        assert(hub_dev);
     
    277277        usb_hub_descriptor_header_t descriptor;
    278278        size_t received_size;
    279         errno_t opResult = usb_request_get_descriptor(control_pipe,
     279        int opResult = usb_request_get_descriptor(control_pipe,
    280280            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE,
    281281            USB_DESCTYPE_HUB, 0, 0, &descriptor,
     
    317317        for (unsigned int port = 0; port < hub_dev->port_count; ++port) {
    318318                usb_log_debug("(%p): Powering port %u.", hub_dev, port);
    319                 const errno_t ret = usb_hub_port_set_feature(
     319                const int ret = usb_hub_port_set_feature(
    320320                    &hub_dev->ports[port], USB_HUB_FEATURE_PORT_POWER);
    321321
     
    343343 * @return error code
    344344 */
    345 static errno_t usb_set_first_configuration(usb_device_t *usb_device)
     345static int usb_set_first_configuration(usb_device_t *usb_device)
    346346{
    347347        assert(usb_device);
     
    369369        /* Set configuration. Use the configuration that was in
    370370         * usb_device->descriptors.configuration i.e. The first one. */
    371         const errno_t opResult = usb_request_set_configuration(
     371        const int opResult = usb_request_set_configuration(
    372372            usb_device_get_default_pipe(usb_device),
    373373            config_descriptor->configuration_number);
     
    406406        /* Over-current condition is gone, it is safe to turn the ports on. */
    407407        for (size_t port = 0; port < hub_dev->port_count; ++port) {
    408                 const errno_t ret = usb_hub_port_set_feature(
     408                const int ret = usb_hub_port_set_feature(
    409409                    &hub_dev->ports[port], USB_HUB_FEATURE_PORT_POWER);
    410410                if (ret != EOK) {
     
    438438        /* NOTE: We can't use standard USB GET_STATUS request, because
    439439         * hubs reply is 4byte instead of 2 */
    440         const errno_t opResult = usb_pipe_control_read(control_pipe,
     440        const int opResult = usb_pipe_control_read(control_pipe,
    441441            &get_hub_status_request, sizeof(get_hub_status_request),
    442442            &status, sizeof(usb_hub_status_t), &rcvd_size);
     
    456456                usb_hub_over_current(hub_dev, status);
    457457                /* Ack change in hub OC flag */
    458                 const errno_t ret = usb_request_clear_feature(
     458                const int ret = usb_request_clear_feature(
    459459                    control_pipe, USB_REQUEST_TYPE_CLASS,
    460460                    USB_REQUEST_RECIPIENT_DEVICE,
     
    480480                 * Just ACK the change.
    481481                 */
    482                 const errno_t ret = usb_request_clear_feature(
     482                const int ret = usb_request_clear_feature(
    483483                    control_pipe, USB_REQUEST_TYPE_CLASS,
    484484                    USB_REQUEST_RECIPIENT_DEVICE,
Note: See TracChangeset for help on using the changeset viewer.