diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2011-06-08 19:12:16 +0400 | 
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2011-06-08 19:12:16 +0400 | 
| commit | c226feb013ce81a18512fb4827bf7c2352d8b470 (patch) | |
| tree | 4415ebda1c24f68bd7b88641f64097111eb359e0 /drivers/tty/tty_buffer.c | |
| parent | 32919a28cc8470b1526f77b2f12cca8841b9ac62 (diff) | |
| parent | 85ec7b970553369e0c956fab1d7a6022f2a99369 (diff) | |
| download | linux-c226feb013ce81a18512fb4827bf7c2352d8b470.tar.xz | |
Merge branch 'for_3.0/gpio-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/merge
Diffstat (limited to 'drivers/tty/tty_buffer.c')
| -rw-r--r-- | drivers/tty/tty_buffer.c | 15 | 
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 46de2e075dac..f1a7918d71aa 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -416,7 +416,6 @@ static void flush_to_ldisc(struct work_struct *work)  		struct tty_buffer *head, *tail = tty->buf.tail;  		int seen_tail = 0;  		while ((head = tty->buf.head) != NULL) { -			int copied;  			int count;  			char *char_buf;  			unsigned char *flag_buf; @@ -443,19 +442,17 @@ static void flush_to_ldisc(struct work_struct *work)  			   line discipline as we want to empty the queue */  			if (test_bit(TTY_FLUSHPENDING, &tty->flags))  				break; +			if (!tty->receive_room || seen_tail) +				break; +			if (count > tty->receive_room) +				count = tty->receive_room;  			char_buf = head->char_buf_ptr + head->read;  			flag_buf = head->flag_buf_ptr + head->read; +			head->read += count;  			spin_unlock_irqrestore(&tty->buf.lock, flags); -			copied = disc->ops->receive_buf(tty, char_buf, +			disc->ops->receive_buf(tty, char_buf,  							flag_buf, count);  			spin_lock_irqsave(&tty->buf.lock, flags); - -			head->read += copied; - -			if (copied == 0 || seen_tail) { -				schedule_work(&tty->buf.work); -				break; -			}  		}  		clear_bit(TTY_FLUSHING, &tty->flags);  	}  | 
