From mboxrd@z Thu Jan 1 00:00:00 1970 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 7297FC388F9 for ; Tue, 27 Oct 2020 15:13:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CF2220657 for ; Tue, 27 Oct 2020 15:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811623; bh=2CuEHpD9ixvCpTVSYRAENPYy0q6XjSB2a6ayoGBj2c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MgHs6I3363PY4YmbeKySK+UkDOoQtsG88Ba7NLea5m5Gp9c/kwCNJCVr3GpxeWgN/ VDp0wzmM0/GGBEx/yZbWf59biGfw7VFSAF3nWR2tpXSKiB3PFtHLEg55AII3EH0BGc LzCu7VShH7vLB8AKEVYxoF6P2tuB1dH3oFpf3Di4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794803AbgJ0PNl (ORCPT ); Tue, 27 Oct 2020 11:13:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:33610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788158AbgJ0PAY (ORCPT ); Tue, 27 Oct 2020 11:00:24 -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 C947C22264; Tue, 27 Oct 2020 15:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810823; bh=2CuEHpD9ixvCpTVSYRAENPYy0q6XjSB2a6ayoGBj2c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=poHgf076KN4GYBs+5pQetOg0FASOSzVIft47+rRlICLuIdO3qhV+yt475kuvsKJxC lDpDH8Hq5y3QjDqrKeOmOzjFTqHau/wtmZB1A+NHV28M1uLEl1ue9CHkZTXbYkY/89 zeeaqQzPhOw8DVA+6rYQ2yJeVoK5Aa0hznV7S4zE= 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.8 274/633] HID: hid-input: fix stylus battery reporting Date: Tue, 27 Oct 2020 14:50:17 +0100 Message-Id: <20201027135535.520962610@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 e3d475f4baf66..b2bff932c524f 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; -- 2.25.1