Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 6883abfa in mainline


Ignore:
Timestamp:
2011-12-14T21:29:38Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
441633f
Parents:
8a01a0b
Message:

libusbdev: usb_destroy_pipes would only ever return EOK.

Location:
uspace/lib/usbdev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/driver.h

    r8a01a0b r6883abfa  
    176176    const usb_endpoint_description_t **, const uint8_t *, size_t, int, int,
    177177    usb_endpoint_mapping_t **, size_t *);
    178 int usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t);
     178void usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t);
    179179
    180180void * usb_device_data_alloc(usb_device_t *, size_t);
  • uspace/lib/usbdev/src/devdrv.c

    r8a01a0b r6883abfa  
    201201 *
    202202 * @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 */
     204static void destroy_current_pipes(usb_device_t *dev)
     205{
     206        usb_device_destroy_pipes(dev->pipes, dev->pipes_count);
    212207        dev->pipes = NULL;
    213208        dev->pipes_count = 0;
    214 
    215         return EOK;
    216 }
    217 
     209}
     210/*----------------------------------------------------------------------------*/
    218211/** Change interface setting of a device.
    219212 * This function selects new alternate setting of an interface by issuing
     
    248241
    249242        /* Destroy existing pipes. */
    250         rc = destroy_current_pipes(dev);
    251         if (rc != EOK) {
    252                 return rc;
    253         }
     243        destroy_current_pipes(dev);
    254244
    255245        /* Change the interface itself. */
     
    422412 * @param[in] pipes_count Number of endpoints.
    423413 */
    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 
     414void usb_device_destroy_pipes(usb_endpoint_mapping_t *pipes, size_t pipes_count)
     415{
    432416        /* Destroy the pipes. */
    433417        for (size_t i = 0; i < pipes_count; ++i) {
     418                assert(pipes);
    434419                usb_log_debug2("Unregistering pipe %zu: %spresent.\n",
    435420                    i, pipes[i].present ? "" : "not ");
     
    437422                        usb_pipe_unregister(&pipes[i].pipe);
    438423        }
    439 
    440424        free(pipes);
    441 
    442         return EOK;
    443425}
    444426
Note: See TracChangeset for help on using the changeset viewer.