X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Ftty%2Fserial%2Fcrisv10.c;h=58e6f61a87e4fe5a747a3f0777446ee702621a73;hb=e359a4e38d229d53e28905863a1fabf41debd591;hp=d567ac5d3af4dcc5a0b8411fef6fab8a7e0d51a9;hpb=5fda7a0e715c32c6dd9a39ebce8429eeafb64b7d;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c index d567ac5d3af4..58e6f61a87e4 100644 --- a/drivers/tty/serial/crisv10.c +++ b/drivers/tty/serial/crisv10.c @@ -3831,14 +3831,13 @@ block_til_ready(struct tty_struct *tty, struct file * filp, DECLARE_WAITQUEUE(wait, current); unsigned long flags; int retval; - int do_clocal = 0, extra_count = 0; + int do_clocal = 0; /* * If the device is in the middle of being closed, then block * until it's done, and then try again. */ - if (tty_hung_up_p(filp) || - (info->port.flags & ASYNC_CLOSING)) { + if (info->port.flags & ASYNC_CLOSING) { wait_event_interruptible_tty(tty, info->port.close_wait, !(info->port.flags & ASYNC_CLOSING)); #ifdef SERIAL_DO_RESTART @@ -3879,10 +3878,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, info->line, info->port.count); #endif local_irq_save(flags); - if (!tty_hung_up_p(filp)) { - extra_count++; - info->port.count--; - } + info->port.count--; local_irq_restore(flags); info->port.blocked_open++; while (1) { @@ -3921,7 +3917,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, } set_current_state(TASK_RUNNING); remove_wait_queue(&info->port.open_wait, &wait); - if (extra_count) + if (!tty_hung_up_p(filp)) info->port.count++; info->port.blocked_open--; #ifdef SERIAL_DEBUG_OPEN @@ -3976,8 +3972,7 @@ rs_open(struct tty_struct *tty, struct file * filp) /* * If the port is in the middle of closing, bail out now */ - if (tty_hung_up_p(filp) || - (info->port.flags & ASYNC_CLOSING)) { + if (info->port.flags & ASYNC_CLOSING) { wait_event_interruptible_tty(tty, info->port.close_wait, !(info->port.flags & ASYNC_CLOSING)); #ifdef SERIAL_DO_RESTART