diff options
| author | Andrew Duggan <aduggan@synaptics.com> | 2012-11-27 22:02:27 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2012-11-28 10:36:18 -0500 |
| commit | b5531318f18b5054c0e4a82beb560a77d85948d8 (patch) | |
| tree | 6c84c9721fc8a52416a644dba5e81e8faad4cbf7 | |
| parent | 7611e8d26d8dd0e5e132b46e905cb579daf9da1e (diff) | |
HID: hidraw: fix signaling SIGIO when hidraw reports an event
This patch fixes sending SIGIO from hidraw_report_event by creating a fasync
handler which adds the fasync entry.
Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| -rw-r--r-- | drivers/hid/hidraw.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 1d8c0219117e..413a73187d33 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
| @@ -295,6 +295,13 @@ out: | |||
| 295 | 295 | ||
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | static int hidraw_fasync(int fd, struct file *file, int on) | ||
| 299 | { | ||
| 300 | struct hidraw_list *list = file->private_data; | ||
| 301 | |||
| 302 | return fasync_helper(fd, file, on, &list->fasync); | ||
| 303 | } | ||
| 304 | |||
| 298 | static int hidraw_release(struct inode * inode, struct file * file) | 305 | static int hidraw_release(struct inode * inode, struct file * file) |
| 299 | { | 306 | { |
| 300 | unsigned int minor = iminor(inode); | 307 | unsigned int minor = iminor(inode); |
| @@ -438,6 +445,7 @@ static const struct file_operations hidraw_ops = { | |||
| 438 | .open = hidraw_open, | 445 | .open = hidraw_open, |
| 439 | .release = hidraw_release, | 446 | .release = hidraw_release, |
| 440 | .unlocked_ioctl = hidraw_ioctl, | 447 | .unlocked_ioctl = hidraw_ioctl, |
| 448 | .fasync = hidraw_fasync, | ||
| 441 | #ifdef CONFIG_COMPAT | 449 | #ifdef CONFIG_COMPAT |
| 442 | .compat_ioctl = hidraw_ioctl, | 450 | .compat_ioctl = hidraw_ioctl, |
| 443 | #endif | 451 | #endif |
