Message ID | 20230922080421.35145-2-wsa+renesas@sang-engineering.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5564946vqi; Fri, 22 Sep 2023 06:16:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCZxvoy9YpGq+tzkdqr5OraBwIFh+GxmbFQTS9QotZCEDXScbskldUnnmN67kfDlxtYXuJ X-Received: by 2002:a17:902:e812:b0:1c5:6b7a:dbb0 with SMTP id u18-20020a170902e81200b001c56b7adbb0mr8332094plg.29.1695388578608; Fri, 22 Sep 2023 06:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695388578; cv=none; d=google.com; s=arc-20160816; b=yjluQ2P1N5yDC7w36wBopKbZ1qpoi2oVsqiBBSF1lsI02GlhG8Y4lQpHmpB6HAMoUH 0NQLcX5yIDQMIhdrb5CH21zXB1CklPO9U8PWjJxNKjxd7QLkHyDAvvqKVjWt8fL3Qlfn Ruh4jSoOr4qcdQ8Atq9LZ8euMqPNM3MeYT9G0917qZQskRCw8eb85TFGRvpnxcfWa6PO PhbuCrihZOMW0BZHcp+Usrf1+IJieyHpBppbmH1sgoMA4wWNKUiPpJ0P4626g68HRx4u UbArxsX/EYtXvDjvzwHpM36arQmk5chUP1kzKXOvabs9bHvjwGIpdMhNn2JDhXB5zbgH 0LTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QKeY3D1+RN2jWEiErP7FIt0WfM1XoXZIvIYk9D2iHHQ=; fh=p7g+v9gIAn0oB7io0SyPzXZQlBusI0VVOGcD13wiyxo=; b=lWCPP6E9kDvclvg2KNN/hDhR1xIuJMzFG3D4+ZDpR2DIvp0HhTJVwACQrEF/AfO5AF 193jyG4kh1ntdoX9m1HbQNJCcRc4/Ac2Hrxi77IJjI24CSnm7TQlU/LA5CITR9OJ+84q l0CzPRCR7IP4p2fsTPYhRMhlckL4G+RSMg37dP+LjgFyuhu7NTtG1aAUwOCqQLWRWY2n MBLBMQLCcTLaL2dPCViGSuy8MMSMii2K99IZL4fQLLRf/LwmltQZteBlL81SirnKjKuX NrC/SrLsTz3y791BO9A83CjJzbdrnXkeAITN4ifCRIK2N0fqkzEz17jGTSPTpoc6JuBB qgkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=R5CTX7Cc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x15-20020a170902a38f00b001bbc066c626si3587693pla.428.2023.09.22.06.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 06:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=R5CTX7Cc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 725AE80A28CE; Fri, 22 Sep 2023 01:15:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232532AbjIVIPh (ORCPT <rfc822;chrisfriedt@gmail.com> + 30 others); Fri, 22 Sep 2023 04:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232548AbjIVIPT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 22 Sep 2023 04:15:19 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A475CE6 for <linux-kernel@vger.kernel.org>; Fri, 22 Sep 2023 01:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=QKeY3D1+RN2jWEiErP7FIt0WfM1XoXZIvIYk9D2iHHQ=; b=R5CTX7 Cc74i2zTJPhTZQsdOeMPilA3jf6l5YB/BPNT6DjiamkKKichgIQfvpJdsnoedKbE jrn3ZzkBABs758k+TSlQGvnSPY1XaSI6U/U+/WB+HtbrZ7GH2S/bdT3cswVy+Mkv 6k2Ql38LtDrlbxezTOyWSK/nAHdMmkjkx/loKRx+dhdN3H7sLv7ReV0oZ/kv2IqD phC8Ejx5aoFLgG/F2+O2baVF1078MLZnsyWFjF3W7FAtWbEmgwC5E0ZlF+JCjquV lLZUejURuSL91NjdLKERq+HLNKSwmIQRS0mnsKpIWGz/jNgIVgtCs2ZkkCM6oKKL u+zHtdccfllf9DRA== Received: (qmail 1310895 invoked from network); 22 Sep 2023 10:04:28 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 22 Sep 2023 10:04:28 +0200 X-UD-Smtp-Session: l3s3148p1@J427Du4FZsIujntX From: Wolfram Sang <wsa+renesas@sang-engineering.com> To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] usb: typec: drop check because i2c_unregister_device() is NULL safe Date: Fri, 22 Sep 2023 10:04:18 +0200 Message-Id: <20230922080421.35145-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230922080421.35145-1-wsa+renesas@sang-engineering.com> References: <20230922080421.35145-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 22 Sep 2023 01:15:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777740994250369363 X-GMAIL-MSGID: 1777743774219686432 |
Series |
treewide: drop check because i2c_unregister_device() is NULL safe
|
|
Commit Message
Wolfram Sang
Sept. 22, 2023, 8:04 a.m. UTC
No need to check the argument of i2c_unregister_device() because the
function itself does it.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Build tested only. Please apply to your tree.
drivers/usb/typec/anx7411.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Quoting Wolfram Sang (2023-09-22 09:04:18) > No need to check the argument of i2c_unregister_device() because the > function itself does it. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> And this is the same pattern here so: Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > --- > Build tested only. Please apply to your tree. > > drivers/usb/typec/anx7411.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c > index 221604f933a4..b12a07edc71b 100644 > --- a/drivers/usb/typec/anx7411.c > +++ b/drivers/usb/typec/anx7411.c > @@ -1550,8 +1550,7 @@ static void anx7411_i2c_remove(struct i2c_client *client) > if (plat->workqueue) > destroy_workqueue(plat->workqueue); > > - if (plat->spi_client) > - i2c_unregister_device(plat->spi_client); > + i2c_unregister_device(plat->spi_client); > > if (plat->typec.role_sw) > usb_role_switch_put(plat->typec.role_sw); > -- > 2.30.2 >
On Fri, Sep 22, 2023 at 12:44 PM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > No need to check the argument of i2c_unregister_device() because the > function itself does it. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c index 221604f933a4..b12a07edc71b 100644 --- a/drivers/usb/typec/anx7411.c +++ b/drivers/usb/typec/anx7411.c @@ -1550,8 +1550,7 @@ static void anx7411_i2c_remove(struct i2c_client *client) if (plat->workqueue) destroy_workqueue(plat->workqueue); - if (plat->spi_client) - i2c_unregister_device(plat->spi_client); + i2c_unregister_device(plat->spi_client); if (plat->typec.role_sw) usb_role_switch_put(plat->typec.role_sw);