update(class/hub/usbh_hub): reduce critical section range
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user