drivers/usbdev: remove first uninitialization and release resouce once.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1
2023-12-13 12:28:36 +08:00
committed by Xiang Xiao
parent 3b39ba72a4
commit ad59ef075f
7 changed files with 27 additions and 198 deletions

View File

@@ -1115,24 +1115,15 @@ void composite_uninitialize(FAR void *handle)
DEBUGASSERT(alloc != NULL);
/* First phase uninitialization each of the member classes */
priv = &alloc->dev;
for (i = 0; i < priv->ndevices; i++)
{
priv->device[i].compdesc.uninitialize(priv->device[i].dev);
}
/* Then unregister and destroy the composite class */
usbdev_unregister(&alloc->drvr.drvr);
/* Free any resources used by the composite driver */
/* None */
/* Second phase uninitialization: Clean up all memory resources */
/* Uninitialization each of the member classes and clean up
* all memory resources
*/
for (i = 0; i < priv->ndevices; i++)
{