summaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serio_raw.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 21:40:41 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 21:40:41 +0100
commit2485a4b610171f4e1c4ab0d053569747795c1bbe (patch)
tree1a4532e447c2640bc1378e25e1ead9a7ba7847a5 /drivers/input/serio/serio_raw.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/msz... (diff)
parentInput: bcm5974 - set BUTTONPAD property (diff)
downloadlinux-2485a4b610171f4e1c4ab0d053569747795c1bbe.tar.xz
linux-2485a4b610171f4e1c4ab0d053569747795c1bbe.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: bcm5974 - set BUTTONPAD property Input: serio_raw - return proper result when serio_raw_write fails Input: serio_raw - really signal HUP upon disconnect Input: serio_raw - remove stray semicolon Input: revert some over-zealous conversions to module_platform_driver()
Diffstat (limited to 'drivers/input/serio/serio_raw.c')
-rw-r--r--drivers/input/serio/serio_raw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index 4d4cd142bbbb..8250299fd64f 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -220,11 +220,11 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
goto out;
}
written++;
- };
+ }
out:
mutex_unlock(&serio_raw_mutex);
- return written;
+ return written ?: retval;
}
static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
@@ -237,9 +237,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
if (serio_raw->head != serio_raw->tail)
- return POLLIN | POLLRDNORM;
+ mask |= POLLIN | POLLRDNORM;
- return 0;
+ return mask;
}
static const struct file_operations serio_raw_fops = {