aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 15:23:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 15:23:20 -0400
commit99dff5856220a02b8711f2e8746413ea6e53ccf6 (patch)
treed8bae7ccdf8f7ad5221b053bb74a6220df996b3a /drivers/input
parentbb74e8ca352eecefdc5c1a9ebab01f18aa2f6f3c (diff)
parentd9a0fbfd7bc5d2c42f0fa9bcbdab62c4942d0388 (diff)
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (48 commits) serial: 8250_pci: add support for Cronyx Omega PCI multiserial board. tty/serial: Fix break handling for PORT_TEGRA tty/serial: Add explicit PORT_TEGRA type n_tracerouter and n_tracesink ldisc additions. Intel PTI implementaiton of MIPI 1149.7. Kernel documentation for the PTI feature. export kernel call get_task_comm(). tty: Remove to support serial for S5P6442 pch_phub: Support new device ML7223 8250_pci: Add support for the Digi/IBM PCIe 2-port Adapter ASoC: Update cx20442 for TTY API change pch_uart: Support new device ML7223 IOH parport: Use request_muxed_region for IT87 probe and lock tty/serial: add support for Xilinx PS UART n_gsm: Use print_hex_dump_bytes drivers/tty/moxa.c: Put correct tty value TTY: tty_io, annotate locking functions TTY: serial_core, remove superfluous set_task_state TTY: serial_core, remove invalid test Char: moxa, fix locking in moxa_write ... Fix up trivial conflicts in drivers/bluetooth/hci_ldisc.c and drivers/tty/serial/Makefile. I did the hci_ldisc thing as an evil merge, cleaning things up.
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/serio/serport.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
index 8755f5f3ad37..f3698967edf6 100644
--- a/drivers/input/serio/serport.c
+++ b/drivers/input/serio/serport.c
@@ -120,17 +120,21 @@ static void serport_ldisc_close(struct tty_struct *tty)
120 * 'interrupt' routine. 120 * 'interrupt' routine.
121 */ 121 */
122 122
123static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) 123static unsigned int serport_ldisc_receive(struct tty_struct *tty,
124 const unsigned char *cp, char *fp, int count)
124{ 125{
125 struct serport *serport = (struct serport*) tty->disc_data; 126 struct serport *serport = (struct serport*) tty->disc_data;
126 unsigned long flags; 127 unsigned long flags;
127 unsigned int ch_flags; 128 unsigned int ch_flags;
129 int ret = 0;
128 int i; 130 int i;
129 131
130 spin_lock_irqsave(&serport->lock, flags); 132 spin_lock_irqsave(&serport->lock, flags);
131 133
132 if (!test_bit(SERPORT_ACTIVE, &serport->flags)) 134 if (!test_bit(SERPORT_ACTIVE, &serport->flags)) {
135 ret = -EINVAL;
133 goto out; 136 goto out;
137 }
134 138
135 for (i = 0; i < count; i++) { 139 for (i = 0; i < count; i++) {
136 switch (fp[i]) { 140 switch (fp[i]) {
@@ -152,6 +156,8 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
152 156
153out: 157out:
154 spin_unlock_irqrestore(&serport->lock, flags); 158 spin_unlock_irqrestore(&serport->lock, flags);
159
160 return ret == 0 ? count : ret;
155} 161}
156 162
157/* 163/*