Changeset 1bab1c8 in mainline
- Timestamp:
- 2018-01-29T15:07:45Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ddbd088
- Parents:
- f3ae58b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/bus.c
rf3ae58b r1bab1c8 173 173 endpoint_t * const ep = dev->endpoints[i]; 174 174 endpoint_add_ref(ep); 175 175 176 176 fibril_mutex_unlock(&dev->guard); 177 bus_endpoint_remove(ep); 177 const int err = bus_endpoint_remove(ep); 178 if (err) 179 usb_log_warning("Endpoint %u cannot be removed. " 180 "Some deffered cleanup was faster?", ep->endpoint); 181 182 endpoint_del_ref(ep); 178 183 fibril_mutex_lock(&dev->guard); 179 184 } 185 186 for (usb_endpoint_t i = 1; i < USB_ENDPOINT_MAX; ++i) 180 187 assert(dev->endpoints[i] == NULL); 181 }182 188 183 189 /* Remove also orphaned children. */ … … 185 191 device_t * const child = list_get_instance(list_first(&dev->devices), device_t, link); 186 192 187 usb_log_warning("USB device '%s' driver left device '%s' behind after %s.", 193 /* 194 * This is not an error condition, as devices cannot remove 195 * their children devices while they are removed, because for 196 * DDF, they are siblings. 197 */ 198 usb_log_debug("USB device '%s' driver left device '%s' behind after %s.", 188 199 ddf_fun_get_name(dev->fun), ddf_fun_get_name(child->fun), op); 200 189 201 /* 190 202 * The child node won't disappear, because its parent's driver … … 463 475 464 476 /** 465 * Remove an endpoint from the device. Consumes a reference.477 * Remove an endpoint from the device. 466 478 */ 467 479 int bus_endpoint_remove(endpoint_t *ep) … … 491 503 492 504 fibril_mutex_lock(&device->guard); 505 506 /* Check whether the endpoint is registered */ 507 if (device->endpoints[idx] != ep) { 508 fibril_mutex_unlock(&device->guard); 509 return EINVAL; 510 } 511 493 512 bus->ops->endpoint_unregister(ep); 494 513 device->endpoints[idx] = NULL; … … 496 515 497 516 /* Bus reference */ 498 endpoint_del_ref(ep);499 500 /* Given reference */501 517 endpoint_del_ref(ep); 502 518
Note:
See TracChangeset
for help on using the changeset viewer.