Skip to content

Commit

Permalink
HID: hidraw: fix signaling SIGIO when hidraw reports an event
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Duggan authored and Jiri Kosina committed Nov 28, 2012
1 parent 7611e8d commit b553131
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ static int hidraw_open(struct inode *inode, struct file *file)

}

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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b553131

Please sign in to comment.