Changeset 6f05705 in mainline
- Timestamp:
- 2011-10-07T17:12:30Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fec6bf2
- Parents:
- 75f9dcd
- Location:
- uspace/drv/bus/usb/usbhub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/port.c
r75f9dcd r6f05705 469 469 assert(port); 470 470 struct add_device_phase1 *data 471 = malloc(sizeof 471 = malloc(sizeof(struct add_device_phase1)); 472 472 if (data == NULL) { 473 473 return ENOMEM; -
uspace/drv/bus/usb/usbhub/usbhub.c
r75f9dcd r6f05705 212 212 info->ports = NULL; 213 213 info->port_count = -1; 214 info->pending_ops_count = 0; 214 215 fibril_mutex_initialize(&info->pending_ops_mutex); 215 216 fibril_condvar_initialize(&info->pending_ops_cv); 216 info->pending_ops_count = 0;217 217 218 218 return info; … … 254 254 // TODO: +1 hack is no longer necessary 255 255 hub_info->ports = 256 malloc(sizeof(usb_hub_port_t) * (hub_info->port_count + 1));256 calloc(hub_info->port_count + 1, sizeof(usb_hub_port_t)); 257 257 if (!hub_info->ports) { 258 258 return ENOMEM; 259 259 } 260 260 261 size_t port; 262 for (port = 0; port < hub_info->port_count + 1; ++port) { 261 for (size_t port = 1; port < hub_info->port_count + 1; ++port) { 263 262 usb_hub_port_init(&hub_info->ports[port], port, control_pipe); 264 263 } … … 271 270 & HUB_CHAR_POWER_PER_PORT_FLAG; 272 271 273 for ( port = 1; port <= hub_info->port_count; ++port) {272 for (size_t port = 1; port <= hub_info->port_count; ++port) { 274 273 usb_log_debug("Powering port %zu.\n", port); 275 274 opResult = usb_hub_port_set_feature(
Note:
See TracChangeset
for help on using the changeset viewer.