usb: device_next: remove initialized state checks in event processing

For the simple events, do not check whether the device driver and stack
are marked as initialized. USB device notification will reschedule
delivery if the stack is not yet marked initialized.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2024-04-12 13:16:49 +02:00 committed by Fabio Baltieri
commit 48f2a4bc1a
2 changed files with 1 additions and 6 deletions

View file

@ -175,10 +175,6 @@ int udc_submit_event(const struct device *dev,
.dev = dev,
};
if (!udc_is_initialized(dev)) {
return -EPERM;
}
return data->event_cb(dev, &drv_evt);
}

View file

@ -193,8 +193,7 @@ static void usbd_thread(void *p1, void *p2, void *p3)
k_msgq_get(&usbd_msgq, &event, K_FOREVER);
STRUCT_SECTION_FOREACH(usbd_contex, uds_ctx) {
if (uds_ctx->dev == event.dev &&
usbd_is_initialized(uds_ctx)) {
if (uds_ctx->dev == event.dev) {
usbd_event_handler(uds_ctx, &event);
}
}