aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunzilog.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-07-07 06:08:27 -0400
committerDave Airlie <airlied@linux.ie>2005-07-07 06:08:27 -0400
commit717cb906bd43a9ac00631d600adda5c6546843a6 (patch)
treef41b250e9e0fa1e664f002fa9c4608d94527f2f2 /drivers/serial/sunzilog.c
parent22f579c621e2f264e6d093b07d75f99bc97d5df2 (diff)
parentc101f3136cc98a003d0d16be6fab7d0d950581a6 (diff)
Merge ../linux-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 8e65206d3d76..bff42a7b89d0 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
610static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port) 610static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port)
611{ 611{
612 struct zilog_channel __iomem *channel; 612 struct zilog_channel __iomem *channel;
613 unsigned long flags;
614 unsigned char status; 613 unsigned char status;
615 614
616 spin_lock_irqsave(&port->lock, flags);
617
618 channel = ZILOG_CHANNEL_FROM_PORT(port); 615 channel = ZILOG_CHANNEL_FROM_PORT(port);
619 status = sbus_readb(&channel->control); 616 status = sbus_readb(&channel->control);
620 ZSDELAY(); 617 ZSDELAY();
621 618
622 spin_unlock_irqrestore(&port->lock, flags);
623
624 return status; 619 return status;
625} 620}
626 621
627/* The port lock is not held. */ 622/* The port lock is not held. */
628static unsigned int sunzilog_tx_empty(struct uart_port *port) 623static unsigned int sunzilog_tx_empty(struct uart_port *port)
629{ 624{
625 unsigned long flags;
630 unsigned char status; 626 unsigned char status;
631 unsigned int ret; 627 unsigned int ret;
632 628
629 spin_lock_irqsave(&port->lock, flags);
630
633 status = sunzilog_read_channel_status(port); 631 status = sunzilog_read_channel_status(port);
632
633 spin_unlock_irqrestore(&port->lock, flags);
634
634 if (status & Tx_BUF_EMP) 635 if (status & Tx_BUF_EMP)
635 ret = TIOCSER_TEMT; 636 ret = TIOCSER_TEMT;
636 else 637 else
@@ -639,7 +640,7 @@ static unsigned int sunzilog_tx_empty(struct uart_port *port)
639 return ret; 640 return ret;
640} 641}
641 642
642/* The port lock is not held. */ 643/* The port lock is held and interrupts are disabled. */
643static unsigned int sunzilog_get_mctrl(struct uart_port *port) 644static unsigned int sunzilog_get_mctrl(struct uart_port *port)
644{ 645{
645 unsigned char status; 646 unsigned char status;