diff options
-rw-r--r-- | drivers/tty/serial/max310x.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index dc0e1ad351f9..97576ff791db 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -753,6 +753,14 @@ static void max310x_handle_tx(struct uart_port *port) | |||
753 | uart_write_wakeup(port); | 753 | uart_write_wakeup(port); |
754 | } | 754 | } |
755 | 755 | ||
756 | static void max310x_start_tx(struct uart_port *port) | ||
757 | { | ||
758 | struct max310x_one *one = container_of(port, struct max310x_one, port); | ||
759 | |||
760 | if (!work_pending(&one->tx_work)) | ||
761 | schedule_work(&one->tx_work); | ||
762 | } | ||
763 | |||
756 | static irqreturn_t max310x_port_irq(struct max310x_port *s, int portno) | 764 | static irqreturn_t max310x_port_irq(struct max310x_port *s, int portno) |
757 | { | 765 | { |
758 | struct uart_port *port = &s->p[portno].port; | 766 | struct uart_port *port = &s->p[portno].port; |
@@ -776,11 +784,8 @@ static irqreturn_t max310x_port_irq(struct max310x_port *s, int portno) | |||
776 | } | 784 | } |
777 | if (rxlen) | 785 | if (rxlen) |
778 | max310x_handle_rx(port, rxlen); | 786 | max310x_handle_rx(port, rxlen); |
779 | if (ists & MAX310X_IRQ_TXEMPTY_BIT) { | 787 | if (ists & MAX310X_IRQ_TXEMPTY_BIT) |
780 | mutex_lock(&s->mutex); | 788 | max310x_start_tx(port); |
781 | max310x_handle_tx(port); | ||
782 | mutex_unlock(&s->mutex); | ||
783 | } | ||
784 | } while (1); | 789 | } while (1); |
785 | return res; | 790 | return res; |
786 | } | 791 | } |
@@ -820,14 +825,6 @@ static void max310x_wq_proc(struct work_struct *ws) | |||
820 | mutex_unlock(&s->mutex); | 825 | mutex_unlock(&s->mutex); |
821 | } | 826 | } |
822 | 827 | ||
823 | static void max310x_start_tx(struct uart_port *port) | ||
824 | { | ||
825 | struct max310x_one *one = container_of(port, struct max310x_one, port); | ||
826 | |||
827 | if (!work_pending(&one->tx_work)) | ||
828 | schedule_work(&one->tx_work); | ||
829 | } | ||
830 | |||
831 | static unsigned int max310x_tx_empty(struct uart_port *port) | 828 | static unsigned int max310x_tx_empty(struct uart_port *port) |
832 | { | 829 | { |
833 | unsigned int lvl, sts; | 830 | unsigned int lvl, sts; |