Changes in uspace/drv/usbhub/usbhub.c [74f00b6:361fcec] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
r74f00b6 r361fcec 73 73 74 74 75 /// \TODO malloc checking76 77 75 //********************************************* 78 76 // … … 248 246 hub_info->ports = malloc( 249 247 sizeof (usb_hub_port_t) * (hub_info->port_count + 1)); 248 if(!hub_info->ports){ 249 return ENOMEM; 250 } 250 251 size_t port; 251 252 for (port = 0; port < hub_info->port_count + 1; ++port) { … … 255 256 usb_log_debug("is_power_switched\n"); 256 257 258 if(!has_individual_port_powering){ 259 usb_log_debug("!has_individual_port_powering\n"); 260 opResult = usb_hub_set_feature(hub_info->control_pipe, 261 USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 262 if (opResult != EOK) { 263 usb_log_error("cannot power hub: %s\n", 264 str_error(opResult)); 265 } 266 } 267 257 268 for (port = 1; port <= hub_info->port_count; ++port) { 258 269 usb_log_debug("Powering port %zu.\n",port); … … 264 275 } 265 276 } 266 if(!has_individual_port_powering){ 267 usb_log_debug("!has_individual_port_powering\n"); 268 opResult = usb_hub_set_feature(hub_info->control_pipe, 269 USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 270 if (opResult != EOK) { 271 usb_log_error("cannot power hub: %s\n", 272 str_error(opResult)); 273 } 274 } 277 275 278 }else{ 276 usb_log_debug("!is_power_switched \n");279 usb_log_debug("!is_power_switched, not going to be powered\n"); 277 280 } 278 281 usb_log_debug2("freeing data\n");
Note:
See TracChangeset
for help on using the changeset viewer.