Commit c993257b authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

serial: core: Unwrap tertiary assignment in uart_handle_dcd_change()

Prepare for spin lock assertion; move non-trivial assignment into
function body.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5435d20f
...@@ -2748,12 +2748,15 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) ...@@ -2748,12 +2748,15 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
{ {
struct tty_port *port = &uport->state->port; struct tty_port *port = &uport->state->port;
struct tty_struct *tty = port->tty; struct tty_struct *tty = port->tty;
struct tty_ldisc *ld = tty ? tty_ldisc_ref(tty) : NULL; struct tty_ldisc *ld;
if (ld) { if (tty) {
if (ld->ops->dcd_change) ld = tty_ldisc_ref(tty);
ld->ops->dcd_change(tty, status); if (ld) {
tty_ldisc_deref(ld); if (ld->ops->dcd_change)
ld->ops->dcd_change(tty, status);
tty_ldisc_deref(ld);
}
} }
uport->icount.dcd++; uport->icount.dcd++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment