Changeset 890961a in mainline for uspace/drv/usbhub/usbhub.c


Ignore:
Timestamp:
2011-04-29T12:37:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e67399e
Parents:
b20de1d (diff), 9d05599 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Fix

File:
1 edited

Legend:

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

    rb20de1d r890961a  
    7373
    7474
    75 /// \TODO malloc checking
    76 
    7775//*********************************************
    7876//
     
    248246        hub_info->ports = malloc(
    249247            sizeof (usb_hub_port_t) * (hub_info->port_count + 1));
     248        if(!hub_info->ports){
     249                return ENOMEM;
     250        }
    250251        size_t port;
    251252        for (port = 0; port < hub_info->port_count + 1; ++port) {
     
    255256                usb_log_debug("is_power_switched\n");
    256257               
    257                 for (port = 1; port <= hub_info->port_count; ++port) {
    258                         usb_log_debug("powering port %d\n",port);
    259                         opResult = usb_hub_set_port_feature(hub_info->control_pipe,
    260                             port, USB_HUB_FEATURE_PORT_POWER);
    261                         if (opResult != EOK) {
    262                                 usb_log_error("cannot power on port %zu: %s.\n",
    263                                     port, str_error(opResult));
    264                         }
    265                 }
    266258                if(!has_individual_port_powering){
    267259                        usb_log_debug("!has_individual_port_powering\n");
     
    273265                        }
    274266                }
     267
     268                for (port = 1; port <= hub_info->port_count; ++port) {
     269                        usb_log_debug("Powering port %zu.\n",port);
     270                        opResult = usb_hub_set_port_feature(hub_info->control_pipe,
     271                            port, USB_HUB_FEATURE_PORT_POWER);
     272                        if (opResult != EOK) {
     273                                usb_log_error("cannot power on port %zu: %s.\n",
     274                                    port, str_error(opResult));
     275                        }
     276                }
     277               
    275278        }else{
    276                 usb_log_debug("!is_power_switched\n");
     279                usb_log_debug("!is_power_switched, not going to be powered\n");
    277280        }
    278281        usb_log_debug2("freeing data\n");
Note: See TracChangeset for help on using the changeset viewer.