Skip to contentSkip to conversation

HID: hidraw: fix signaling SIGIO when hidraw reports an event

PATCH Applied Andrew Duggan 2 participants 2 messages Nov 28, 2012 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: hidraw: fix signaling SIGIO when hidraw reports an event

Hi Jiri and Linux-Input,

This patch fixes sending SIGIO from hidraw_report_event by creating a fasync handler which adds the fasync entry.

---
 drivers/hid/hidraw.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/hid/hidraw.c +8 -0
index 7c47fc3..d4a5af4 100644
@@ -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
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 30 lines · Andrew Duggan

Hi Jiri and Linux-Input,

This patch fixes sending SIGIO from hidraw_report_event by creating a fasync handler which adds the fasync entry.

---
 drivers/hid/hidraw.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/hid/hidraw.c +7 -0
index 7c47fc3..d4a5af4 100644
@@ -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);

drivers/hid/hidraw.c static const struct file_operations hidraw_ops = { · line 451

Quoted 7 lines
drivers/hid/hidraw.c +1 -0
@@ -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

Right you are!

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs