Changeset 399a13c in mainline for uspace/lib/usbdev/src/devdrv.c


Ignore:
Timestamp:
2011-05-30T13:50:33Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17d1542
Parents:
a5fc431 (diff), 8971926 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Development changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/devdrv.c

    ra5fc431 r399a13c  
    533533}
    534534
     535/** Destroy instance of a USB device.
     536 *
     537 * @param dev Device to be destroyed.
     538 */
     539void usb_device_destroy(usb_device_t *dev)
     540{
     541        if (dev == NULL) {
     542                return;
     543        }
     544
     545        /* Ignore errors and hope for the best. */
     546        usb_device_destroy_pipes(dev->ddf_dev, dev->pipes, dev->pipes_count);
     547        if (dev->descriptors.configuration != NULL) {
     548                free(dev->descriptors.configuration);
     549        }
     550
     551        if (dev->alternate_interfaces != NULL) {
     552                if (dev->alternate_interfaces->alternatives != NULL) {
     553                        free(dev->alternate_interfaces->alternatives);
     554                }
     555                free(dev->alternate_interfaces);
     556        }
     557
     558        free(dev);
     559}
     560
    535561/**
    536562 * @}
Note: See TracChangeset for help on using the changeset viewer.