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: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Peter Hurley 2014-09-02 17:39:21 -04:00 committed by Greg Kroah-Hartman
parent 5435d20f50
commit c993257bf7
1 changed files with 8 additions and 5 deletions

View File

@ -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_struct *tty = port->tty;
struct tty_ldisc *ld = tty ? tty_ldisc_ref(tty) : NULL;
struct tty_ldisc *ld;
if (ld) {
if (ld->ops->dcd_change)
ld->ops->dcd_change(tty, status);
tty_ldisc_deref(ld);
if (tty) {
ld = tty_ldisc_ref(tty);
if (ld) {
if (ld->ops->dcd_change)
ld->ops->dcd_change(tty, status);
tty_ldisc_deref(ld);
}
}
uport->icount.dcd++;