aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/sunzilog.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-06-30 00:49:18 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-30 00:49:18 -0400
commit0c168775709faa74c1b87f1e61046e0c51ade7f3 (patch)
treec40fd8818c64c5d7d1d90afab0bd6ffd94505526 /drivers/serial/sunzilog.c
parent9bd481f85940726bf66aae5cd03c5b912ad0ae4c (diff)
parent9b4311eedb17fa88f02e4876cd6aa9a08e383cd6 (diff)
Merge upstream 2.6.13-rc1-git1 into 'ieee80211' branch of netdev-2.6.
Diffstat (limited to 'drivers/serial/sunzilog.c')
-rw-r--r--drivers/serial/sunzilog.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 8e65206d3d7..bff42a7b89d 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -610,27 +610,28 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg
static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port)
{
struct zilog_channel __iomem *channel;
- unsigned long flags;
unsigned char status;
- spin_lock_irqsave(&port->lock, flags);
-
channel = ZILOG_CHANNEL_FROM_PORT(port);
status = sbus_readb(&channel->control);
ZSDELAY();
- spin_unlock_irqrestore(&port->lock, flags);
-
return status;
}
/* The port lock is not held. */
static unsigned int sunzilog_tx_empty(struct uart_port *port)
{
+ unsigned long flags;
unsigned char status;
unsigned int ret;
+ spin_lock_irqsave(&port->lock, flags);
+
status = sunzilog_read_channel_status(port);
+
+ spin_unlock_irqrestore(&port->lock, flags);
+
if (status & Tx_BUF_EMP)
ret = TIOCSER_TEMT;
else
@@ -639,7 +640,7 @@ static unsigned int sunzilog_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 sunzilog_get_mctrl(struct uart_port *port)
{
unsigned char status;