aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ipack
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ipack')
-rw-r--r--drivers/ipack/devices/Kconfig2
-rw-r--r--drivers/ipack/devices/ipoctal.c19
2 files changed, 8 insertions, 13 deletions
diff --git a/drivers/ipack/devices/Kconfig b/drivers/ipack/devices/Kconfig
index 0b82fdc198c0..907a8cb48f2a 100644
--- a/drivers/ipack/devices/Kconfig
+++ b/drivers/ipack/devices/Kconfig
@@ -1,6 +1,6 @@
1config SERIAL_IPOCTAL 1config SERIAL_IPOCTAL
2 tristate "IndustryPack IP-OCTAL uart support" 2 tristate "IndustryPack IP-OCTAL uart support"
3 depends on IPACK_BUS 3 depends on IPACK_BUS && TTY
4 help 4 help
5 This driver supports the IPOCTAL serial port device for the IndustryPack bus. 5 This driver supports the IPOCTAL serial port device for the IndustryPack bus.
6 default n 6 default n
diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c
index 576d53d92677..ab20a0851dd2 100644
--- a/drivers/ipack/devices/ipoctal.c
+++ b/drivers/ipack/devices/ipoctal.c
@@ -133,9 +133,9 @@ static int ipoctal_get_icount(struct tty_struct *tty,
133 return 0; 133 return 0;
134} 134}
135 135
136static void ipoctal_irq_rx(struct ipoctal_channel *channel, 136static void ipoctal_irq_rx(struct ipoctal_channel *channel, u8 sr)
137 struct tty_struct *tty, u8 sr)
138{ 137{
138 struct tty_port *port = &channel->tty_port;
139 unsigned char value; 139 unsigned char value;
140 unsigned char flag = TTY_NORMAL; 140 unsigned char flag = TTY_NORMAL;
141 u8 isr; 141 u8 isr;
@@ -149,7 +149,7 @@ static void ipoctal_irq_rx(struct ipoctal_channel *channel,
149 if (sr & SR_OVERRUN_ERROR) { 149 if (sr & SR_OVERRUN_ERROR) {
150 channel->stats.overrun_err++; 150 channel->stats.overrun_err++;
151 /* Overrun doesn't affect the current character*/ 151 /* Overrun doesn't affect the current character*/
152 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 152 tty_insert_flip_char(port, 0, TTY_OVERRUN);
153 } 153 }
154 if (sr & SR_PARITY_ERROR) { 154 if (sr & SR_PARITY_ERROR) {
155 channel->stats.parity_err++; 155 channel->stats.parity_err++;
@@ -165,7 +165,7 @@ static void ipoctal_irq_rx(struct ipoctal_channel *channel,
165 flag = TTY_BREAK; 165 flag = TTY_BREAK;
166 } 166 }
167 } 167 }
168 tty_insert_flip_char(tty, value, flag); 168 tty_insert_flip_char(port, value, flag);
169 169
170 /* Check if there are more characters in RX FIFO 170 /* Check if there are more characters in RX FIFO
171 * If there are more, the isr register for this channel 171 * If there are more, the isr register for this channel
@@ -175,7 +175,7 @@ static void ipoctal_irq_rx(struct ipoctal_channel *channel,
175 sr = ioread8(&channel->regs->r.sr); 175 sr = ioread8(&channel->regs->r.sr);
176 } while (isr & channel->isr_rx_rdy_mask); 176 } while (isr & channel->isr_rx_rdy_mask);
177 177
178 tty_flip_buffer_push(tty); 178 tty_flip_buffer_push(port);
179} 179}
180 180
181static void ipoctal_irq_tx(struct ipoctal_channel *channel) 181static void ipoctal_irq_tx(struct ipoctal_channel *channel)
@@ -208,15 +208,11 @@ static void ipoctal_irq_tx(struct ipoctal_channel *channel)
208static void ipoctal_irq_channel(struct ipoctal_channel *channel) 208static void ipoctal_irq_channel(struct ipoctal_channel *channel)
209{ 209{
210 u8 isr, sr; 210 u8 isr, sr;
211 struct tty_struct *tty;
212 211
213 /* If there is no client, skip the check */ 212 /* If there is no client, skip the check */
214 if (!atomic_read(&channel->open)) 213 if (!atomic_read(&channel->open))
215 return; 214 return;
216 215
217 tty = tty_port_tty_get(&channel->tty_port);
218 if (!tty)
219 return;
220 /* The HW is organized in pair of channels. See which register we need 216 /* The HW is organized in pair of channels. See which register we need
221 * to read from */ 217 * to read from */
222 isr = ioread8(&channel->block_regs->r.isr); 218 isr = ioread8(&channel->block_regs->r.isr);
@@ -235,14 +231,13 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
235 231
236 /* RX data */ 232 /* RX data */
237 if ((isr & channel->isr_rx_rdy_mask) && (sr & SR_RX_READY)) 233 if ((isr & channel->isr_rx_rdy_mask) && (sr & SR_RX_READY))
238 ipoctal_irq_rx(channel, tty, sr); 234 ipoctal_irq_rx(channel, sr);
239 235
240 /* TX of each character */ 236 /* TX of each character */
241 if ((isr & channel->isr_tx_rdy_mask) && (sr & SR_TX_READY)) 237 if ((isr & channel->isr_tx_rdy_mask) && (sr & SR_TX_READY))
242 ipoctal_irq_tx(channel); 238 ipoctal_irq_tx(channel);
243 239
244 tty_flip_buffer_push(tty); 240 tty_flip_buffer_push(&channel->tty_port);
245 tty_kref_put(tty);
246} 241}
247 242
248static irqreturn_t ipoctal_irq_handler(void *arg) 243static irqreturn_t ipoctal_irq_handler(void *arg)