diff mbox

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

Message ID 1354071747-14007-1-git-send-email-aduggan@synaptics.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Andrew Duggan Nov. 28, 2012, 3:02 a.m. UTC
Hi Jiri and Linux-Input,

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>
---
 drivers/hid/hidraw.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jiri Kosina Nov. 28, 2012, 3:38 p.m. UTC | #1
On Tue, 27 Nov 2012, Andrew Duggan wrote:

> Hi Jiri and Linux-Input,
> 
> 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>
> ---
>  drivers/hid/hidraw.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
> index 7c47fc3..d4a5af4 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

Right you are!

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 7c47fc3..d4a5af4 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