diff options
Diffstat (limited to 'drivers/tty/serial/xilinx_uartps.c')
-rw-r--r-- | drivers/tty/serial/xilinx_uartps.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 9ab910370c56..82a3151e393c 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c | |||
@@ -147,15 +147,11 @@ | |||
147 | static irqreturn_t xuartps_isr(int irq, void *dev_id) | 147 | static irqreturn_t xuartps_isr(int irq, void *dev_id) |
148 | { | 148 | { |
149 | struct uart_port *port = (struct uart_port *)dev_id; | 149 | struct uart_port *port = (struct uart_port *)dev_id; |
150 | struct tty_struct *tty; | ||
151 | unsigned long flags; | 150 | unsigned long flags; |
152 | unsigned int isrstatus, numbytes; | 151 | unsigned int isrstatus, numbytes; |
153 | unsigned int data; | 152 | unsigned int data; |
154 | char status = TTY_NORMAL; | 153 | char status = TTY_NORMAL; |
155 | 154 | ||
156 | /* Get the tty which could be NULL so don't assume it's valid */ | ||
157 | tty = tty_port_tty_get(&port->state->port); | ||
158 | |||
159 | spin_lock_irqsave(&port->lock, flags); | 155 | spin_lock_irqsave(&port->lock, flags); |
160 | 156 | ||
161 | /* Read the interrupt status register to determine which | 157 | /* Read the interrupt status register to determine which |
@@ -187,14 +183,11 @@ static irqreturn_t xuartps_isr(int irq, void *dev_id) | |||
187 | } else if (isrstatus & XUARTPS_IXR_OVERRUN) | 183 | } else if (isrstatus & XUARTPS_IXR_OVERRUN) |
188 | port->icount.overrun++; | 184 | port->icount.overrun++; |
189 | 185 | ||
190 | if (tty) | 186 | uart_insert_char(port, isrstatus, XUARTPS_IXR_OVERRUN, |
191 | uart_insert_char(port, isrstatus, | 187 | data, status); |
192 | XUARTPS_IXR_OVERRUN, data, | ||
193 | status); | ||
194 | } | 188 | } |
195 | spin_unlock(&port->lock); | 189 | spin_unlock(&port->lock); |
196 | if (tty) | 190 | tty_flip_buffer_push(&port->state->port); |
197 | tty_flip_buffer_push(tty); | ||
198 | spin_lock(&port->lock); | 191 | spin_lock(&port->lock); |
199 | } | 192 | } |
200 | 193 | ||
@@ -237,7 +230,6 @@ static irqreturn_t xuartps_isr(int irq, void *dev_id) | |||
237 | 230 | ||
238 | /* be sure to release the lock and tty before leaving */ | 231 | /* be sure to release the lock and tty before leaving */ |
239 | spin_unlock_irqrestore(&port->lock, flags); | 232 | spin_unlock_irqrestore(&port->lock, flags); |
240 | tty_kref_put(tty); | ||
241 | 233 | ||
242 | return IRQ_HANDLED; | 234 | return IRQ_HANDLED; |
243 | } | 235 | } |