| 197 | } |
| 198 | |
| 199 | static int serial_tty_open(struct lwp_tty *tp) |
| 200 | { |
| 201 | struct serial_tty_context *softc; |
| 202 | struct rt_serial_device *serial; |
| 203 | rt_err_t error; |
| 204 | int oflags; |
| 205 | |
| 206 | softc = tty_softc(tp); |
| 207 | serial = softc->parent; |
| 208 | |
| 209 | LOG_D("%s", __func__); |
| 210 | |
| 211 | rt_device_control(&serial->parent, RT_DEVICE_CTRL_CONSOLE_OFLAG, &oflags); |
| 212 | |
| 213 | error = rt_device_open(&serial->parent, oflags); |
| 214 | |
| 215 | if (!error) |
| 216 | { |
| 217 | /** |
| 218 | * to avoid driver accesssing null data, |
| 219 | * these are setup only after tty is registered |
| 220 | */ |
| 221 | _setup_serial(serial, tp, softc); |
| 222 | } |
| 223 | return error; |
| 224 | } |
| 225 | |
| 226 | static void serial_tty_close(struct lwp_tty *tp) |
| 227 | { |
nothing calls this directly
no test coverage detected