diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-06-10 15:16:16 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-06-18 13:42:00 +0200 |
commit | d937ae5fae17e63aaa97f029be221a6516b25475 (patch) | |
tree | 2ef5c99a73fe3d9c9ef2e85bdf72d0807b170d5b /drivers/gpio | |
parent | 1f9dec1e0164b48da9b268a02197f38caa69b118 (diff) | |
download | op-kernel-dev-d937ae5fae17e63aaa97f029be221a6516b25475.zip op-kernel-dev-d937ae5fae17e63aaa97f029be221a6516b25475.tar.gz |
HID: uhid: implement read() on uhid devices
User-space can use read() to get a single event from uhid devices. read()
does never return multiple events. This allows us to extend the event
structure and still keep backwards compatibility.
If user-space wants to get multiple events in one syscall, they should use
the readv()/writev() syscalls which are supported by uhid.
This introduces a new lock which helps us synchronizing simultaneous reads
from user-space. We also correctly return -EINVAL/-EFAULT only on errors
and retry the read() when some other thread captured the event faster than
we did.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/gpio')
0 files changed, 0 insertions, 0 deletions