refactor(osal): use osal malloc and free, remove usb_malloc & usb_free macro

This commit is contained in:
sakumisu
2024-07-23 19:37:54 +08:00
parent 1927566dfc
commit 1c2fd3407a
7 changed files with 46 additions and 6 deletions

View File

@@ -486,7 +486,7 @@ int usbh_enumerate(struct usbh_hubport *hport)
goto errout;
}
USB_LOG_INFO("The device has %d interfaces\r\n", ((struct usb_configuration_descriptor *)ep0_request_buffer[hport->bus->busid])->bNumInterfaces);
hport->raw_config_desc = usb_malloc(wTotalLength);
hport->raw_config_desc = usb_osal_malloc(wTotalLength);
if (hport->raw_config_desc == NULL) {
ret = -USB_ERR_NOMEM;
USB_LOG_ERR("No memory to alloc for raw_config_desc\r\n");
@@ -576,7 +576,7 @@ int usbh_enumerate(struct usbh_hubport *hport)
errout:
if (hport->raw_config_desc) {
usb_free(hport->raw_config_desc);
usb_osal_free(hport->raw_config_desc);
hport->raw_config_desc = NULL;
}
return ret;