From patchwork Tue Oct 27 13:48:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290103 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=ham 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 45AB0C5DF9D for ; Tue, 27 Oct 2020 14:12:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03F3F2076A for ; Tue, 27 Oct 2020 14:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807962; bh=Kz/RB3eu55Y/c3Qn/xRk6I4YHCGlMK2/L6EWIHnbBBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vzRavMi6TXwtV+tEphwm67/sURujkWfhmcFPl7W7uSBegLJeyd0utGMr3eZGewp3n 32Q0zIsum9mHtsEYywXg0pbEk91tphQwv/haiHPk8ahhUJ9iHy0/b6xtcU/PiHUfpl Fa/0YxCmH1qEvltg+bxH7LglihQZ5I4NPCMiozLo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756328AbgJ0OMk (ORCPT ); Tue, 27 Oct 2020 10:12:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:33750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756313AbgJ0OMf (ORCPT ); Tue, 27 Oct 2020 10:12:35 -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 3F3652076A; Tue, 27 Oct 2020 14:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807953; bh=Kz/RB3eu55Y/c3Qn/xRk6I4YHCGlMK2/L6EWIHnbBBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQmkSlzloXHAW4LFh2cO6/RMVI+UcADNx/CzYtDijYovndUBw3BH59hShJkFcKltF 3eV5R7JdCN2yXSCQTDiu2V5/0sJxQNXJuUj90VsGlFUTqsZW9LWYH/sdzHXPzz8CW8 15hRMOJrXJGzyEgV4ZjIi8VZd1kxt/5kIGoL0AI4= 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 4.14 071/191] HID: hid-input: fix stylus battery reporting Date: Tue, 27 Oct 2020 14:48:46 +0100 Message-Id: <20201027134913.133824306@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@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 3624d6e3384ff..07a043ae69f12 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -796,7 +796,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); @@ -1043,7 +1043,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;