Changeset 0892663a in mainline for uspace/lib/usbhost/src/ddf_helpers.c
- Timestamp:
- 2018-01-11T04:14:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9848c77
- Parents:
- bad4a05
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 03:59:03)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 04:14:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/ddf_helpers.c
rbad4a05 r0892663a 336 336 assert(device); 337 337 338 hc_device_t *hcd = dev_to_hcd(device); 339 assert(hcd); 340 assert(hcd->bus); 338 device_t *victim = NULL; 341 339 342 340 fibril_mutex_lock(&hub->guard); 343 344 device_t *victim = NULL;345 346 341 list_foreach(hub->devices, link, device_t, it) { 347 342 if (it->port == port) { … … 350 345 } 351 346 } 352 if (victim) {353 assert(victim->fun);354 assert(victim->port == port);355 assert(victim->hub == hub);356 list_remove(&victim->link);357 fibril_mutex_unlock(&hub->guard);358 const int ret = ddf_fun_unbind(victim->fun);359 if (ret == EOK) {360 bus_device_remove(victim);361 ddf_fun_destroy(victim->fun);362 } else {363 usb_log_warning("Failed to unbind device `%s': %s\n",364 ddf_fun_get_name(victim->fun), str_error(ret));365 }366 return EOK;367 }368 347 fibril_mutex_unlock(&hub->guard); 369 return ENOENT; 348 349 if (!victim) 350 return ENOENT; 351 352 assert(victim->fun); 353 assert(victim->port == port); 354 assert(victim->hub == hub); 355 356 bus_device_remove(victim); 357 return EOK; 370 358 } 371 359 … … 477 465 } 478 466 479 fibril_mutex_lock(&hub->guard);480 list_append(&dev->link, &hub->devices);481 fibril_mutex_unlock(&hub->guard);482 483 467 return EOK; 484 468
Note:
See TracChangeset
for help on using the changeset viewer.