Changeset 890961a in mainline for uspace/drv/usbhub/usbhub.c
- Timestamp:
- 2011-04-29T12:37:42Z (14 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
rb20de1d r890961a 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 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 }266 258 if(!has_individual_port_powering){ 267 259 usb_log_debug("!has_individual_port_powering\n"); … … 273 265 } 274 266 } 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 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.