diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/serial_core.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 8c3dd36fe91a..78dd1e7120a9 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
491 | { | 491 | { |
492 | struct uart_state *state = uport->state; | 492 | struct uart_state *state = uport->state; |
493 | struct tty_port *port = &state->port; | 493 | struct tty_port *port = &state->port; |
494 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); | ||
495 | struct timespec ts; | ||
494 | 496 | ||
495 | uport->icount.dcd++; | 497 | if (ld && ld->ops->dcd_change) |
498 | getnstimeofday(&ts); | ||
496 | 499 | ||
500 | uport->icount.dcd++; | ||
497 | #ifdef CONFIG_HARD_PPS | 501 | #ifdef CONFIG_HARD_PPS |
498 | if ((uport->flags & UPF_HARDPPS_CD) && status) | 502 | if ((uport->flags & UPF_HARDPPS_CD) && status) |
499 | hardpps(); | 503 | hardpps(); |
@@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
505 | else if (port->tty) | 509 | else if (port->tty) |
506 | tty_hangup(port->tty); | 510 | tty_hangup(port->tty); |
507 | } | 511 | } |
512 | |||
513 | if (ld && ld->ops->dcd_change) | ||
514 | ld->ops->dcd_change(port->tty, status, &ts); | ||
515 | if (ld) | ||
516 | tty_ldisc_deref(ld); | ||
508 | } | 517 | } |
509 | 518 | ||
510 | /** | 519 | /** |