aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serio_raw.c
diff options
context:
space:
mode:
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,
220 goto out; 220 goto out;
221 } 221 }
222 written++; 222 written++;
223 }; 223 }
224 224
225out: 225out:
226 mutex_unlock(&serio_raw_mutex); 226 mutex_unlock(&serio_raw_mutex);
227 return written; 227 return written ?: retval;
228} 228}
229 229
230static unsigned int serio_raw_poll(struct file *file, poll_table *wait) 230static 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)
237 237
238 mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM; 238 mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
239 if (serio_raw->head != serio_raw->tail) 239 if (serio_raw->head != serio_raw->tail)
240 return POLLIN | POLLRDNORM; 240 mask |= POLLIN | POLLRDNORM;
241 241
242 return 0; 242 return mask;
243} 243}
244 244
245static const struct file_operations serio_raw_fops = { 245static const struct file_operations serio_raw_fops = {