Skip to content

Commit

Permalink
usb: device_next: cdc_acm: set the thread name after initializing it
Browse files Browse the repository at this point in the history
The cdc-acm workqueue thread name is set before initializing it right
now, which results in an empty thread name as apparently it gets cleared
by k_work_queue_init. Fix it by moving the thread name setting after the
workqueu is initialized and started.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri authored and kartben committed Dec 27, 2024
1 parent fb1fcec commit 5a8671e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions subsys/usb/device_next/class/usbd_cdc_acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ static int usbd_cdc_acm_init_wq(void)
k_work_queue_start(&cdc_acm_work_q, cdc_acm_stack,
K_KERNEL_STACK_SIZEOF(cdc_acm_stack),
CONFIG_SYSTEM_WORKQUEUE_PRIORITY, NULL);
k_thread_name_set(&cdc_acm_work_q.thread, "cdc_acm_work_q");

return 0;
}
Expand All @@ -1037,8 +1038,6 @@ static int usbd_cdc_acm_preinit(const struct device *dev)
ring_buf_reset(data->tx_fifo.rb);
ring_buf_reset(data->rx_fifo.rb);

k_thread_name_set(&cdc_acm_work_q.thread, "cdc_acm_work_q");

k_work_init_delayable(&data->tx_fifo_work, cdc_acm_tx_fifo_handler);
k_work_init(&data->rx_fifo_work, cdc_acm_rx_fifo_handler);
k_work_init(&data->irq_cb_work, cdc_acm_irq_cb_handler);
Expand Down

0 comments on commit 5a8671e

Please sign in to comment.