summaryrefslogtreecommitdiff
path: root/components/drivers/serial
diff options
context:
space:
mode:
authorzms123456 <[email protected]>2024-04-16 11:15:37 +0800
committerGitHub <[email protected]>2024-04-15 23:15:37 -0400
commit6ad0b2bd093d26771bc1348d9bcda7eac7e1dc52 (patch)
treece28db06b0ba21aaa674ce8221e4c9f88d4c0fd3 /components/drivers/serial
parentd10fb37c05a82518a00fc7eb2a84ea905d11e042 (diff)
[components][drivers]fix workqueue bug
fix workqueue bug
Diffstat (limited to 'components/drivers/serial')
-rw-r--r--components/drivers/serial/serial_tty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/drivers/serial/serial_tty.c b/components/drivers/serial/serial_tty.c
index 85c30dbfeb..c31aa8e3c6 100644
--- a/components/drivers/serial/serial_tty.c
+++ b/components/drivers/serial/serial_tty.c
@@ -146,7 +146,6 @@ rt_inline void _setup_serial(struct rt_serial_device *serial, lwp_tty_t tp,
rt_device_init(&serial->parent);
- rt_work_init(&softc->work, _tty_rx_worker, tp);
rt_device_control(&serial->parent, RT_DEVICE_CTRL_NOTIFY_SET, &notify);
}
@@ -295,6 +294,7 @@ rt_err_t rt_hw_serial_register_tty(struct rt_serial_device *serial)
if (tty)
{
rc = lwp_tty_register(tty, dev_name);
+ rt_work_init(&softc->work, _tty_rx_worker, tty);
if (rc != RT_EOK)
{