From patchwork Wed Nov 28 03:02:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Duggan X-Patchwork-Id: 1813751 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 40A0E3FD1A for ; Wed, 28 Nov 2012 03:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752357Ab2K1DMk (ORCPT ); Tue, 27 Nov 2012 22:12:40 -0500 Received: from us-mx3.synaptics.com ([12.239.217.85]:22253 "EHLO us-mx3.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310Ab2K1DMj (ORCPT ); Tue, 27 Nov 2012 22:12:39 -0500 X-Greylist: delayed 574 seconds by postgrey-1.27 at vger.kernel.org; Tue, 27 Nov 2012 22:12:39 EST Received: from unknown (HELO usw-ex2k7-owa1.synaptics-inc.local) ([172.20.1.254]) by us-mx3.synaptics.com with ESMTP; 27 Nov 2012 19:03:04 -0800 Received: from noble.synaptics-inc.local (172.16.31.64) by usw-ex2k7-owa1.synaptics-inc.local (172.16.200.60) with Microsoft SMTP Server (TLS) id 8.2.176.0; Tue, 27 Nov 2012 19:02:26 -0800 From: Andrew Duggan To: CC: Andrew Duggan , , Subject: [PATCH] HID: hidraw: fix signaling SIGIO when hidraw reports an event Date: Tue, 27 Nov 2012 19:02:27 -0800 Message-ID: <1354071747-14007-1-git-send-email-aduggan@synaptics.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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