Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3984512ybl; Mon, 12 Aug 2019 09:28:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKrpORJmglZB0sR+7lxWl7X/ZPWuGpjYFJc5XjYStKF1MAXoqYBcn5UBeMOvq36M+RFeK4 X-Received: by 2002:a17:90a:9604:: with SMTP id v4mr133773pjo.66.1565627326165; Mon, 12 Aug 2019 09:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565627326; cv=none; d=google.com; s=arc-20160816; b=D5o75tk1xXHcw6knAq4b84T/t4rGF8bV5s4nGrqiI4df+pQwT+pQBjPlB0TEJuy9VJ ErqURBA3A5Tdsc0vh4vFmb0LZHr23wADxjc4xHwZe//joLUB4dlAnrC8p5bZ4+wchnl9 dahRB+4DbgCcqv/w7aoUeVQh01uM75C+xg9CE3SOcNOJVHOXxu0yLeRYMj9CANNuhlnl p3WxzHR8SrlC+RZDSk/giaEfcaEfofJWrPZ69qPVSfY2MYHXCbmsfx8ANvLE6PcfbfXG ajXyHoMkzm63QdDVPzOp74krnzQf69ZCkQwSEDDXK4MYtkBHnTYHp/OBXZJIddVb4QGA 1E8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2Bu1ldU8NlerqJrEA4JUK9UdlyDkPj4cQLNkuLNxwNE=; b=dkhaJgGsrJ8JyYMpnPCQpRfBGOsN8nuCL5JmoXCMHjvtl/G8VRbu7/rVp86IO8ogvr kj9WV0Y/nAVzPqy9LWdMPgmaiNzfdkIKOzbdKql1IDkSVgTuTDGk3HkW5I3gIcJ6F6kn Rm8vOoAoViEcd4FRzMQY7H6DAEkN/1bYXo4WB8VyaRb0KPp/++4ZT00Do2IjgWS6ykwk R6kQKD9+nHnt6smit+N3dmJv502h4Fjv9WIfgy6sIxRydHH7UvjxGhZUSRK1I4UzoRkh FlXmnU+sSqRiaJ2XZ6u7bhmSk1/YMXMqX2vNIkq8x7VYA09Uo+6EQ4MSk2nX7JShYxIl m2Sg== 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 cp10si60752309plb.301.2019.08.12.09.28.30; Mon, 12 Aug 2019 09:28:46 -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 S1726889AbfHLQ1y (ORCPT + 99 others); Mon, 12 Aug 2019 12:27:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12657 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbfHLQ1y (ORCPT ); Mon, 12 Aug 2019 12:27:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 097DF3083362; Mon, 12 Aug 2019 16:27:54 +0000 (UTC) Received: from plouf.redhat.com (ovpn-117-165.ams2.redhat.com [10.36.117.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF4FB5C1B5; Mon, 12 Aug 2019 16:27:51 +0000 (UTC) From: Benjamin Tissoires To: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= , Jonathan Cameron , Srinivas Pandruvada , Ping Cheng , Jason Gerecke , Jiri Kosina Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 2/2] HID: wacom: do not call hid_set_drvdata(hdev, NULL) Date: Mon, 12 Aug 2019 18:27:40 +0200 Message-Id: <20190812162740.15898-3-benjamin.tissoires@redhat.com> In-Reply-To: <20190812162740.15898-1-benjamin.tissoires@redhat.com> References: <20190812162740.15898-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 12 Aug 2019 16:27:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a common pattern in the HID drivers to reset the drvdata. However, this is actually already handled by driver core, so there is no need to do it manually. Signed-off-by: Benjamin Tissoires --- drivers/hid/wacom_sys.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 53bddb50aeba..69ccfdd51a6f 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2718,14 +2718,12 @@ static int wacom_probe(struct hid_device *hdev, wacom_wac->features = *((struct wacom_features *)id->driver_data); features = &wacom_wac->features; - if (features->check_for_hid_type && features->hid_type != hdev->type) { - error = -ENODEV; - goto fail; - } + if (features->check_for_hid_type && features->hid_type != hdev->type) + return -ENODEV; error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL); if (error) - goto fail; + return error; wacom_wac->hid_data.inputmode = -1; wacom_wac->mode_report = -1; @@ -2743,12 +2741,12 @@ static int wacom_probe(struct hid_device *hdev, error = hid_parse(hdev); if (error) { hid_err(hdev, "parse failed\n"); - goto fail; + return error; } error = wacom_parse_and_register(wacom, false); if (error) - goto fail; + return error; if (hdev->bus == BUS_BLUETOOTH) { error = device_create_file(&hdev->dev, &dev_attr_speed); @@ -2759,10 +2757,6 @@ static int wacom_probe(struct hid_device *hdev, } return 0; - -fail: - hid_set_drvdata(hdev, NULL); - return error; } static void wacom_remove(struct hid_device *hdev) @@ -2791,8 +2785,6 @@ static void wacom_remove(struct hid_device *hdev) wacom_release_resources(wacom); kfifo_free(&wacom_wac->pen_fifo); - - hid_set_drvdata(hdev, NULL); } #ifdef CONFIG_PM -- 2.19.2