diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-29 21:00:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-29 21:00:38 -0700 |
commit | 0b35ff23b2633eb996d666e5a49a5d49b8a6a2d3 (patch) | |
tree | 6e0a8c2bbd33c1cec2af6fbb1a6665751c07a631 /drivers/serial/ip22zilog.c | |
parent | 92dd7ca0af8f769569bde98a83b4a8f4daec6ac5 (diff) | |
parent | 026d02a236f429eb61a1277166bd425f8514c431 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-serial
Diffstat (limited to 'drivers/serial/ip22zilog.c')
-rw-r--r-- | drivers/serial/ip22zilog.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c index 3ea46c069f6..ea5bf4d4daa 100644 --- a/drivers/serial/ip22zilog.c +++ b/drivers/serial/ip22zilog.c @@ -518,27 +518,28 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id, struct pt_regs *re static __inline__ unsigned char ip22zilog_read_channel_status(struct uart_port *port) { struct zilog_channel *channel; - unsigned long flags; unsigned char status; - spin_lock_irqsave(&port->lock, flags); - channel = ZILOG_CHANNEL_FROM_PORT(port); status = readb(&channel->control); ZSDELAY(); - spin_unlock_irqrestore(&port->lock, flags); - return status; } /* The port lock is not held. */ static unsigned int ip22zilog_tx_empty(struct uart_port *port) { + unsigned long flags; unsigned char status; unsigned int ret; + spin_lock_irqsave(&port->lock, flags); + status = ip22zilog_read_channel_status(port); + + spin_unlock_irqrestore(&port->lock, flags); + if (status & Tx_BUF_EMP) ret = TIOCSER_TEMT; else @@ -547,7 +548,7 @@ static unsigned int ip22zilog_tx_empty(struct uart_port *port) return ret; } -/* The port lock is not held. */ +/* The port lock is held and interrupts are disabled. */ static unsigned int ip22zilog_get_mctrl(struct uart_port *port) { unsigned char status; |