From: Andrew Duggan Date: Wed, 28 Nov 2012 03:02:27 +0000 (-0800) Subject: HID: hidraw: fix signaling SIGIO when hidraw reports an event X-Git-Tag: v3.8-rc1~130^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5531318f18b5054c0e4a82beb560a77d85948d8;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 1d8c021..413a731 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -295,6 +295,13 @@ out: } +static int hidraw_fasync(int fd, struct file *file, int on) +{ + struct hidraw_list *list = file->private_data; + + return fasync_helper(fd, file, on, &list->fasync); +} + static int hidraw_release(struct inode * inode, struct file * file) { unsigned int minor = iminor(inode); @@ -438,6 +445,7 @@ static const struct file_operations hidraw_ops = { .open = hidraw_open, .release = hidraw_release, .unlocked_ioctl = hidraw_ioctl, + .fasync = hidraw_fasync, #ifdef CONFIG_COMPAT .compat_ioctl = hidraw_ioctl, #endif