update(class/hub/usbh_hub): reduce critical section range

Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
sakumisu
2025-06-04 13:08:51 +08:00
parent 078e7d1be0
commit 6b7d755d3a

View File

@@ -706,8 +706,6 @@ int usbh_hub_deinitialize(struct usbh_bus *bus)
struct usbh_hub *hub; struct usbh_hub *hub;
size_t flags; size_t flags;
flags = usb_osal_enter_critical_section();
hub = &bus->hcd.roothub; hub = &bus->hcd.roothub;
for (uint8_t port = 0; port < hub->nports; port++) { for (uint8_t port = 0; port < hub->nports; port++) {
hport = &hub->child[port]; hport = &hub->child[port];
@@ -715,6 +713,8 @@ int usbh_hub_deinitialize(struct usbh_bus *bus)
usbh_hubport_release(hport); usbh_hubport_release(hport);
} }
flags = usb_osal_enter_critical_section();
usb_hc_deinit(bus); usb_hc_deinit(bus);
usb_osal_leave_critical_section(flags); usb_osal_leave_critical_section(flags);