Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1373447pxb; Thu, 4 Nov 2021 00:47:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA2YvbVLs6a1IJ3UuLoP4sgqae+NHeBhGC/YAbnFJwnEBDkKrRWs0HYlDgIdlR0FUr4m5N X-Received: by 2002:a5e:a914:: with SMTP id c20mr2422225iod.101.1636012041513; Thu, 04 Nov 2021 00:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636012041; cv=none; d=google.com; s=arc-20160816; b=mUt9DcJoasEoIVTK5KQiynbp9uXcdbZqYgmLGInnwbvUmNAkPCzrc1fPnC4HzIH/Oz taY82oAaCBoGZ7n6RELL8Ze7vaYl2zhkrsaC0p2BcXV0Of4Ah+zS2lII9XSLpFJmyVe2 N3agij3qv8OBmsk+M3su++1WdoVpH1hnKAIgkTfSAIDfjSkp7Xyo4Dv9yhrwdT3xzhLq 9aSxhD4SDD+7d6BR3S6MdhBDv+NexTbv7PrgaDUda+bxyBv2v3mQGcwzf9bc05ivmLuM f8aQe5yM019QBpNA9oM8AAkXIP4Uk1g63PADBMYw2WHchtjpINQrMlYRH0h1KLHy9gRn w78w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=FCgu2WXEFAsBA7Fz6okNXkvEbUUeMwlB1ggGs4KD0dQ=; b=nTojwCl4vceAAwmxFdPgEX57zpQ0lJvZxtidyndoRAbaexBvqreySacVtaEWdNwl3o DNbkCHfXdFvZ0oCWb6I71RAbNyI2V4hSgwlsGCCqdKJKB0rZRIKTWUUsKGx2S3ZqSikN EGLTq6O6k9iJ5Z5VC704Z+bdvd0DUkcQOatBrTibJS+3eexb7TMFBFKgRG9rcbPM7Mik BMKUUu7FC8ooOoC+TYYKfvQbcqo0KJ0MNpqz1jrAyZGDoSkfLPQJJOjBhCYKY9UFRec7 DIWrrwQL59ZK5ErbNQpJW/y+QLSM7ksNtxH+OT4RFY3H059OS9h0h1mSI//teR8yAiFd 7BBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si6180398ios.88.2021.11.04.00.47.07; Thu, 04 Nov 2021 00:47:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbhKDHsp (ORCPT + 99 others); Thu, 4 Nov 2021 03:48:45 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:41936 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230084AbhKDHso (ORCPT ); Thu, 4 Nov 2021 03:48:44 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-05 (Coremail) with SMTP id zQCowAD3t_Spj4NhSIdBBg--.50132S2; Thu, 04 Nov 2021 15:45:45 +0800 (CST) From: Jiasheng Jiang To: jikos@kernel.org, benjamin.tissoires@redhat.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] HID: wacom: Add parse before start Date: Thu, 4 Nov 2021 07:45:44 +0000 Message-Id: <1636011944-3424006-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: zQCowAD3t_Spj4NhSIdBBg--.50132S2 X-Coremail-Antispam: 1UD129KBjvJXoW7uryDurWDWFWkKr13Kw4UJwb_yoW8Xw17pw 17C3s8ArZrtr4jva17AryUJry5Gw4xKryxuFy5G3WYvFn5Jr1UAa1xKF1Y9ry8GF48G3Wa kr45ta4DKF1UZ3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkv14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_GF4l 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUh4SOUUUUU= X-Originating-IP: [124.16.138.128] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It might be better to add hid_parse() before wacom_parse_and_register() to ask for the report descriptor like what wacom_probe() does. Fixes: 471d171 ("Input: wacom - move the USB (now hid) Wacom driver in drivers/hid") Signed-off-by: Jiasheng Jiang --- drivers/hid/wacom_sys.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 57bfa0a..48cb2e4 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2486,6 +2486,9 @@ static void wacom_wireless_work(struct work_struct *work) wacom_wac1->pid = wacom_wac->pid; hid_hw_stop(hdev1); + error = hid_parse(wacom1->hdev); + if (error) + goto fail; error = wacom_parse_and_register(wacom1, true); if (error) goto fail; @@ -2498,6 +2501,9 @@ static void wacom_wireless_work(struct work_struct *work) *((struct wacom_features *)id->driver_data); wacom_wac2->pid = wacom_wac->pid; hid_hw_stop(hdev2); + error = hid_parse(wacom2->hdev); + if (error) + goto fail; error = wacom_parse_and_register(wacom2, true); if (error) goto fail; @@ -2710,12 +2716,18 @@ static void wacom_mode_change_work(struct work_struct *work) } if (wacom1) { + error = hid_parse(wacom1->hdev); + if (error) + return; error = wacom_parse_and_register(wacom1, false); if (error) return; } if (wacom2) { + error = hid_parse(wacom2->hdev); + if (error) + return; error = wacom_parse_and_register(wacom2, false); if (error) return; -- 2.7.4