Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1427746ybl; Fri, 16 Aug 2019 15:05:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8UlxFsIogvCQsUid8/fQLnKQ5IIJQzQrz9pt5aGcbyNbuOO4N06Gyh3BgSx+10f31JyaB X-Received: by 2002:a63:6205:: with SMTP id w5mr8740678pgb.199.1565993129894; Fri, 16 Aug 2019 15:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565993129; cv=none; d=google.com; s=arc-20160816; b=PCcYsOUnq9xqTIEx/oU1ducjjDulXYuBk+IFb9q8BwEf2Lg+dDQNb79pA/sHXPprUK Z7u99j1JzcKglgSgSyb1krqN/JGsp+HVy93G4zxBIXmxE9VfhgWC6DJ89KcGwn7JOMDG 9Ut70+4kyLeDtwnaIJlqXbvPleLFoO2oBNms9tDUsPBD0rR5yPJHrDp1yEKFB1R+QKkL 1AjElXIEFkmUTOIZxfuckMb41vx+GedmbjhwWQeJchmZ1AYTmofKFlylccEaxL61eZ9F YJh+cN5fv7lCJUgS/vAwlmrUgzPqFrHouG2658lfLaSElJ0rAnRPK5kXfuwvD2sLIAWh gAhQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+w2U2crS2vYRRyWIjo0qOL4Zpteqtr+zKOK/7hnhR/E=; b=OmX92WkY3dn5lba9vLJ9FWE+XYM0lTX88rr5WvO8GuxAtD8oDsOrXKoQtGmTw2NCM6 jU8HGmNqq95cE13arxKDcSsj34MO6OT4p0wLH23b6brQiBmF3ZHEnQ9B0CpwO2FeV1Xe 7PtNcNTxyTVlvqxt0NVO1qgpJ5qo2a3Kgy9GXMTyUBXDqMV0Mf3KmXMULdxg/8lk5opS CUxdt5awM8sCIUSkTgIIIxGroOtOCpRofFaeyZxSns6PKFtdFWlI301jvb7Tjo7MoXcn VV3TeZk6Hh+WaklEtY/sznc8fl2XjgM1FADjp91UMIdsTEfCwdx8+PtvCb5mtn+CktkN U57w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l1F5DOKT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id br21si3066684pjb.14.2019.08.16.15.05.14; Fri, 16 Aug 2019 15:05:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l1F5DOKT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727758AbfHPWED (ORCPT + 99 others); Fri, 16 Aug 2019 18:04:03 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42264 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727709AbfHPWED (ORCPT ); Fri, 16 Aug 2019 18:04:03 -0400 Received: by mail-pf1-f194.google.com with SMTP id i30so3781418pfk.9; Fri, 16 Aug 2019 15:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=+w2U2crS2vYRRyWIjo0qOL4Zpteqtr+zKOK/7hnhR/E=; b=l1F5DOKT/ow7/8fIvTG4D5ibJbrThnomLRRwUvMuk4X+Upj9jA27qTzag79sVIojb/ AW5Z2jtlcSj+Pv9LTdF3obeReU60kYbLeN2/y9FwXCgTBibsd4AjjCRkVbf6A3paHdKe pV24YMI3zulrvc/rDAZCkn2GaM/41uJk0bohWd33h0+z2jCKOcrdelf+cQeJ8bFVdWnU xvWh3LoQ8ZWW/yTR+CvLT545JBTnZ1GyqjmlpeQv9Rzoz+uuYDdHrdNjaH1YKWyJck/h c1QirhD7fR6mzpEEXUX/4JjyhCi8BtxBgBqTdV4SN13F5rAQESWMTtNnqKnDbZFx3bJF RtPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=+w2U2crS2vYRRyWIjo0qOL4Zpteqtr+zKOK/7hnhR/E=; b=FW/FlgMkSGwmgc0/WGplxKsmL7g/Qmqdg9JbCgiLM3LPNmRNIflQsVVjqE5r0eLEdH rC2Uvxk6WaURhpUgbI/MiwiT1AM2JRF1jJg0m/GKDlyUY2TcHsx5MSyuRnuFYGDRRwdp VUX1BO0F+Qne0xLvvnIDposwBoswO6wx3mLxKRcF3We3qqqg+mLqjE9pZ1UC3ccUzd3G 78L2+1qmaU3vyl5qXWzsji/D3GB7YumofaQThkZVvbjRPcPCQMKYqprrE+F7bapV6aqC PeEIFH94X+G9mjWJYRMlwZ4PZYaz69VRq+4SSODN6hOk+DBfNBlUwoV1Dk3qo7rdBDEO TCTA== X-Gm-Message-State: APjAAAXMkDYrQt3CWdQuiKTx5AhYOuIvsKPn9VHH0Ftm8wX1Hz3x9IdQ MPBwMGFY4O0X1AHAkv7fXocJnGEkn3LmOC004rc= X-Received: by 2002:a65:64c6:: with SMTP id t6mr9762346pgv.323.1565993042598; Fri, 16 Aug 2019 15:04:02 -0700 (PDT) MIME-Version: 1.0 References: <20190812162740.15898-1-benjamin.tissoires@redhat.com> <20190812162740.15898-3-benjamin.tissoires@redhat.com> In-Reply-To: <20190812162740.15898-3-benjamin.tissoires@redhat.com> From: Jason Gerecke Date: Fri, 16 Aug 2019 15:03:51 -0700 Message-ID: Subject: Re: [PATCH 2/2] HID: wacom: do not call hid_set_drvdata(hdev, NULL) To: Benjamin Tissoires Cc: =?UTF-8?Q?Bruno_Pr=C3=A9mont?= , Jonathan Cameron , Srinivas Pandruvada , Ping Cheng , Jason Gerecke , Jiri Kosina , Linux Input , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 12, 2019 at 9:29 AM Benjamin Tissoires wrote: > > 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 Acked-by: Jason Gerecke Jason --- Now instead of four in the eights place / you=E2=80=99ve got three, =E2=80=98Cause you added one / (That is to say, eight) to the two, / But you can=E2=80=99t take seven from three, / So you look at the sixty-fours.... > --- > 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 =3D *((struct wacom_features *)id->driver_dat= a); > features =3D &wacom_wac->features; > > - if (features->check_for_hid_type && features->hid_type !=3D hdev-= >type) { > - error =3D -ENODEV; > - goto fail; > - } > + if (features->check_for_hid_type && features->hid_type !=3D hdev-= >type) > + return -ENODEV; > > error =3D kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP= _KERNEL); > if (error) > - goto fail; > + return error; > > wacom_wac->hid_data.inputmode =3D -1; > wacom_wac->mode_report =3D -1; > @@ -2743,12 +2741,12 @@ static int wacom_probe(struct hid_device *hdev, > error =3D hid_parse(hdev); > if (error) { > hid_err(hdev, "parse failed\n"); > - goto fail; > + return error; > } > > error =3D wacom_parse_and_register(wacom, false); > if (error) > - goto fail; > + return error; > > if (hdev->bus =3D=3D BUS_BLUETOOTH) { > error =3D 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 >