aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ipack/devices/ipoctal.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
commit21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch)
treed995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/ipack/devices/ipoctal.c
parent74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff)
parent9e17df37d710f8998e9cb10a548304fe33d4a5c2 (diff)
Merge tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial patches from Greg Kroah-Hartman: "Here's the big tty/serial driver patches for 3.9-rc1. More tty port rework and fixes from Jiri here, as well as lots of individual serial driver updates and fixes. All of these have been in the linux-next tree for a while." * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits) tty: mxser: improve error handling in mxser_probe() and mxser_module_init() serial: imx: fix uninitialized variable warning serial: tegra: assume CONFIG_OF TTY: do not update atime/mtime on read/write lguest: select CONFIG_TTY to build properly. ARM defconfigs: add missing inclusions of linux/platform_device.h fb/exynos: include platform_device.h ARM: sa1100/assabet: include platform_device.h directly serial: imx: Fix recursive locking bug pps: Fix build breakage from decoupling pps from tty tty: Remove ancient hardpps() pps: Additional cleanups in uart_handle_dcd_change pps: Move timestamp read into PPS code proper pps: Don't crash the machine when exiting will do pps: Fix a use-after free bug when unregistering a source. pps: Use pps_lookup_dev to reduce ldisc coupling pps: Add pps_lookup_dev() function tty: serial: uartlite: Support uartlite on big and little endian systems tty: serial: uartlite: Fix sparse and checkpatch warnings serial/arc-uart: Miscll DT related updates (Grant's review comments) ... Fix up trivial conflicts, mostly just due to the TTY config option clashing with the EXPERIMENTAL removal.
Diffstat (limited to 'drivers/ipack/devices/ipoctal.c')
-rw-r--r--drivers/ipack/devices/ipoctal.c19
1 files changed, 7 insertions, 12 deletions
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)