Skip to content

Commit 3f6960b

Browse files
authored
[smart/tty] skip configure of rt_serial on tty open (#9152)
Skip configure on open since all configs are copied from the current configuration on device. So we don't bother to set it back to device again. Changes: - test and skip configuration on open() of tty device Signed-off-by: Shell <[email protected]>
1 parent 4d0b048 commit 3f6960b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/drivers/serial/serial_tty.c

+10
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,16 @@ static int serial_tty_param(struct lwp_tty *tp, struct termios *t)
298298
RT_ASSERT(softc);
299299
serial = softc->parent;
300300

301+
if (!tty_opened(tp))
302+
{
303+
/**
304+
* skip configure on open since all configs are copied from the current
305+
* configuration on device. So we don't bother to set it back to device
306+
* again.
307+
*/
308+
return RT_EOK;
309+
}
310+
301311
cfsetispeed(t, t->__c_ispeed);
302312
return rt_device_control(&(serial->parent), TCSETS, t);
303313
}

0 commit comments

Comments
 (0)