Changeset 6883abfa in mainline
- Timestamp:
- 2011-12-14T21:29:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 441633f
- Parents:
- 8a01a0b
- Location:
- uspace/lib/usbdev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/driver.h
r8a01a0b r6883abfa 176 176 const usb_endpoint_description_t **, const uint8_t *, size_t, int, int, 177 177 usb_endpoint_mapping_t **, size_t *); 178 intusb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t);178 void usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t); 179 179 180 180 void * usb_device_data_alloc(usb_device_t *, size_t); -
uspace/lib/usbdev/src/devdrv.c
r8a01a0b r6883abfa 201 201 * 202 202 * @param dev Device where to destroy the pipes. 203 * @return Error code. 204 */ 205 static int destroy_current_pipes(usb_device_t *dev) 206 { 207 const int rc = usb_device_destroy_pipes(dev->pipes, dev->pipes_count); 208 if (rc != EOK) { 209 return rc; 210 } 211 203 */ 204 static void destroy_current_pipes(usb_device_t *dev) 205 { 206 usb_device_destroy_pipes(dev->pipes, dev->pipes_count); 212 207 dev->pipes = NULL; 213 208 dev->pipes_count = 0; 214 215 return EOK; 216 } 217 209 } 210 /*----------------------------------------------------------------------------*/ 218 211 /** Change interface setting of a device. 219 212 * This function selects new alternate setting of an interface by issuing … … 248 241 249 242 /* Destroy existing pipes. */ 250 rc = destroy_current_pipes(dev); 251 if (rc != EOK) { 252 return rc; 253 } 243 destroy_current_pipes(dev); 254 244 255 245 /* Change the interface itself. */ … … 422 412 * @param[in] pipes_count Number of endpoints. 423 413 */ 424 int usb_device_destroy_pipes(usb_endpoint_mapping_t *pipes, size_t pipes_count) 425 { 426 if (pipes_count == 0) { 427 assert(pipes == NULL); 428 return EOK; 429 } 430 assert(pipes != NULL); 431 414 void usb_device_destroy_pipes(usb_endpoint_mapping_t *pipes, size_t pipes_count) 415 { 432 416 /* Destroy the pipes. */ 433 417 for (size_t i = 0; i < pipes_count; ++i) { 418 assert(pipes); 434 419 usb_log_debug2("Unregistering pipe %zu: %spresent.\n", 435 420 i, pipes[i].present ? "" : "not "); … … 437 422 usb_pipe_unregister(&pipes[i].pipe); 438 423 } 439 440 424 free(pipes); 441 442 return EOK;443 425 } 444 426
Note:
See TracChangeset
for help on using the changeset viewer.