From patchwork Tue Oct 27 13:49:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43A85C63699 for ; Tue, 27 Oct 2020 16:36:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB6EF21707 for ; Tue, 27 Oct 2020 16:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603816599; bh=O1Bv4Z9DszUfWEUzrbjrOcrk1+Kj0qBsYa/puo4dkKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e0ysaLnYwVeQvIwYnlTNf0+soo0qTfUevwWdt1iQ9jyZ+3+rLSBCkLjdiC6GmeChQ M1xZK7JHr1QV4NTx6nQryDhD6+PJmtF6Ix6wcEkNQZU1x8rTZET99hN8gPnPtwqQ5F TSDA+ESRmYjm/ZE8oQi0aaYpC0JUp9So2YXAXY/E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1801981AbgJ0PpS (ORCPT ); Tue, 27 Oct 2020 11:45:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:50592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1799756AbgJ0PdM (ORCPT ); Tue, 27 Oct 2020 11:33:12 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF60622263; Tue, 27 Oct 2020 15:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812791; bh=O1Bv4Z9DszUfWEUzrbjrOcrk1+Kj0qBsYa/puo4dkKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gm9Jp6oe3/BTR+xzA3RW/1ASdY8BHZ1XXeEEsg83rLElC377Jg5AXLOaDdymgOWZ2 oJUVHBKc9JzzDmsMUxdDJxVgKZKTMnbhWWU/iwGnu/lAqPLehW7MBAW/5YC5AcHQPn PH+SxiAqTZAwgHR4DSde2rHZCy41OwHiG2GzJq9g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kenneth Albanowski , Dmitry Torokhov , Jiri Kosina , Sasha Levin Subject: [PATCH 5.9 331/757] HID: hid-input: fix stylus battery reporting Date: Tue, 27 Oct 2020 14:49:41 +0100 Message-Id: <20201027135506.075605341@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dmitry Torokhov [ Upstream commit 505f394fa239cecb76d916aa858f87ed7ea7fde4 ] With commit 4f3882177240 hid-input started clearing of "ignored" usages to avoid using garbage that might have been left in them. However "battery strength" usages should not be ignored, as we do want to use them. Fixes: 4f3882177240 ("HID: hid-input: clear unmapped usages") Reported-by: Kenneth Albanowski Tested-by: Kenneth Albanowski Signed-off-by: Dmitry Torokhov Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 88e19996427e6..9770db624bfaf 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x3b: /* Battery Strength */ hidinput_setup_battery(device, HID_INPUT_REPORT, field); usage->type = EV_PWR; - goto ignore; + return; case 0x3c: /* Invert */ map_key_clear(BTN_TOOL_RUBBER); @@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case HID_DC_BATTERYSTRENGTH: hidinput_setup_battery(device, HID_INPUT_REPORT, field); usage->type = EV_PWR; - goto ignore; + return; } goto unknown;