Changeset 2489353 in mainline for uspace/lib/usbdev/src/devdrv.c
- Timestamp:
- 2018-01-13T20:47:58Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7dddd7b
- Parents:
- 1ed3eb4
- git-author:
- Petr Manek <petr.manek@…> (2018-01-13 18:38:22)
- git-committer:
- Petr Manek <petr.manek@…> (2018-01-13 20:47:58)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
r1ed3eb4 r2489353 48 48 #include <devman.h> 49 49 #include <errno.h> 50 #include <str_error.h> 50 51 #include <stdlib.h> 51 52 … … 299 300 300 301 /* Destroy the pipes. */ 302 int rc; 301 303 for (size_t i = 0; i < usb_dev->pipes_count; ++i) { 302 304 usb_log_debug2("Unregistering pipe %zu: %spresent.\n", 303 305 i, usb_dev->pipes[i].present ? "" : "not "); 304 if (usb_dev->pipes[i].present) 305 usb_pipe_unregister(&usb_dev->pipes[i].pipe); 306 307 rc = usb_device_unmap_ep(usb_dev->pipes + i); 308 if (rc != EOK && rc != ENOENT) 309 usb_log_warning("Unregistering pipe %zu failed: %s", i, str_error(rc)); 306 310 } 307 311 … … 337 341 } 338 342 return NULL; 343 } 344 345 int usb_device_unmap_ep(usb_endpoint_mapping_t *epm) 346 { 347 assert(epm); 348 349 if (!epm->present) 350 return ENOENT; 351 352 const int rc = usb_pipe_unregister(&epm->pipe); 353 if (rc != EOK) 354 return rc; 355 356 epm->present = false; 357 return EOK; 339 358 } 340 359
Note:
See TracChangeset
for help on using the changeset viewer.