Received: by 10.213.65.68 with SMTP id h4csp307778imn; Tue, 20 Mar 2018 04:12:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELu9GhW3KyyvrJQvZk584zD0asijnRZ1BcjrysjCZUsnqcuvOMRO+pXtKsn+A9xJW0RYo0FH X-Received: by 2002:a17:902:227:: with SMTP id 36-v6mr15655664plc.134.1521544338233; Tue, 20 Mar 2018 04:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521544338; cv=none; d=google.com; s=arc-20160816; b=TOefQv006Rk/Dfqnc8/SPsHtMXwy+60Do32qRkIPp6Ce0IelAo8LZheHPTycycoJ6l nwkOQJubAWRzhgm5h2wGiINmFxiXHtP6ilPbDbLJXVj4tKUBwktNCvoJfHaYb+Fn7khb dZawv9c7g7map97FYPdA9ndNC3ZW7lNKiLE+9jHztdB/xlEjFXyTbFYgXJ62lOafO07w WLtfFhjAoUzxUCnYca6geM4jm1YbC5Y6iduhsRcjrQ2mMPOmOR8zbO5ZuvN2cB7ErNiD +zZrE2k2QtVG99T3ka7xn4RZAUmp9oZkEpyUJ868eyUOggUa++ub/Gea4kagGFyUE/QK Y4FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OGPrlvbnzn2xtw643bSln/c80FDiS6wv8J+Rw+MoERc=; b=aGm8E3kN3CAib8B6olwjrg+SJJmWcShy6kFkoCztyMtWmq9qENQCqAAwpn6ytN40r+ 1H+3KG22qC2vEhgXV56QuO0uxdTeMz1T2fNJQCTuq9kHELnCXjKA6AB9gT1mIXmDeA29 x7jeUIQIiLsAdrBqrkc36t+8sUYEwXb4VRIHmX+9gsb57svjNQRWlQe4C7Ddm8sPiVnK drjlAwIg+EwW8S+vrXlYWqoUH2rsVdJL/uzvgP/vgCcO1VBEP1o+5CzQ6hDHZWEaZXJO 1ZoVMOalu9tqVm86QzSBJHWy33wTZhMjq0pgagbQGtEziaGO9y3DJZx+uJ4Eks/g7KHl 3lag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si1039956pgq.230.2018.03.20.04.12.03; Tue, 20 Mar 2018 04:12:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbeCTLJI (ORCPT + 99 others); Tue, 20 Mar 2018 07:09:08 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35140 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752794AbeCTLFI (ORCPT ); Tue, 20 Mar 2018 07:05:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECB8AA1BEB; Tue, 20 Mar 2018 11:05:07 +0000 (UTC) Received: from plouf.banquise.eu.com (ovpn-116-181.ams2.redhat.com [10.36.116.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id F406F10B0F3D; Tue, 20 Mar 2018 11:05:06 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 7/7] HID: core: reset the quirks before calling probe again Date: Tue, 20 Mar 2018 12:04:51 +0100 Message-Id: <20180320110451.16582-8-benjamin.tissoires@redhat.com> In-Reply-To: <20180320110451.16582-1-benjamin.tissoires@redhat.com> References: <20180320110451.16582-1-benjamin.tissoires@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 20 Mar 2018 11:05:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 20 Mar 2018 11:05:08 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'benjamin.tissoires@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Given that now the quirk handling is done in hid-quirk.c, we can actually reset the quirks before calling .probe(), so that the drivers do not need to keep track of initial quirks. Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 2 ++ drivers/hid/hid-multitouch.c | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 36af26c2565b..5d7cc6bbbac6 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1966,6 +1966,8 @@ static int hid_device_probe(struct device *dev) } } + /* reset the quirks that has been previously set */ + hdev->quirks = hid_lookup_quirk(hdev); hdev->driver = hdrv; if (hdrv->probe) { ret = hdrv->probe(hdev, id); diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 639c44fc0691..dad2fbb0e3f8 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -127,7 +127,6 @@ struct mt_device { int left_button_state; /* left button state */ unsigned last_slot_field; /* the last field of a slot */ unsigned mt_report_id; /* the report ID of the multitouch device */ - unsigned long initial_quirks; /* initial quirks state */ __s16 inputmode; /* InputMode HID feature, -1 if non-existent */ __s16 inputmode_index; /* InputMode HID feature index in the report */ __s16 maxcontact_report_id; /* Maximum Contact Number HID feature, @@ -1453,11 +1452,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) if (id->vendor == HID_ANY_ID && id->product == HID_ANY_ID) td->serial_maybe = true; - /* - * Store the initial quirk state - */ - td->initial_quirks = hdev->quirks; - /* This allows the driver to correctly support devices * that emit events over several HID messages. */ @@ -1527,7 +1521,6 @@ static void mt_remove(struct hid_device *hdev) sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group); hid_hw_stop(hdev); - hdev->quirks = td->initial_quirks; } /* -- 2.14.3