From patchwork Wed May 29 14:19:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 2630471 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 243B640077 for ; Wed, 29 May 2013 14:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966187Ab3E2OTx (ORCPT ); Wed, 29 May 2013 10:19:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59859 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966092Ab3E2OTw (ORCPT ); Wed, 29 May 2013 10:19:52 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D42FFA52D9; Wed, 29 May 2013 16:19:50 +0200 (CEST) Date: Wed, 29 May 2013 16:19:49 +0200 (CEST) From: Jiri Kosina To: Srinivas Pandruvada Cc: Daniel Leung , srinivas.pandruvada@intel.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: hid-sensor-hub: do not process feature reports in raw_event In-Reply-To: <516588E2.4030901@linux.intel.com> Message-ID: References: <1363886546-6517-1-git-send-email-daniel.leung@linux.intel.com> <51507136.4020308@linux.intel.com> <38514.10.7.197.74.1365440092.squirrel@linux.intel.com> <33544.10.7.197.74.1365551736.squirrel@linux.intel.com> <516588E2.4030901@linux.intel.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Wed, 10 Apr 2013, Srinivas Pandruvada wrote: > I don't know if this should be fixed in client drivers since other drivers may > have this issue. Agreed. Srinivas, how about the patch below, could you please test it in your scenario to see whether it actually fixes the issue? Thanks. diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 264f550..65879b9 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1293,7 +1293,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) { ret = hdrv->raw_event(hid, report, data, size); - if (ret != 0) { + if (ret < 0) { ret = ret < 0 ? ret : 0; goto unlock; }