From patchwork Wed Oct 19 08:30:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp300520wrs; Wed, 19 Oct 2022 05:34:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5bYtIb16szgHVcTkoLrCu1xfPt11LSq3UtorB9wYn7TYo8xZGwUlsJXfAhOEyEueyOlSy6 X-Received: by 2002:a17:903:124e:b0:178:6946:a2ba with SMTP id u14-20020a170903124e00b001786946a2bamr8123807plh.89.1666182871977; Wed, 19 Oct 2022 05:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666182871; cv=none; d=google.com; s=arc-20160816; b=gPzwFrmue3oNmT6ERa1RXdccM3mTMuI0/w8rYgmMbz72kzMPfkDviSYYht/vAHRgxI qC5U88wnoDPm3PiI75drkK3CJ+IfNJ6w1p+pxy7OmkfbtkvzLdwHp0K4siiIeA6ewpig BEEyYTbYQWPycqWk5xVmqgYkRFQZg0BlRRqOF3Bw4nKB7u7plAXeHp1MWXPXhxqs+T/N uMaCoHfoWxKsdi1aWAKzGMDvx5FBKtfxRoBjVNEhsJjnyY85BeZbxiwDUuB2d3J9HDig zMAfN5lDBeOrTN8Om/oU5p3Omzx1rpafmdGZBH/qmvqNiXgb3cnXZwgyvu2D0mZgyfJY 5A8g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AktuG8X1SBIue15VZejGJ55iMtm0O+7ONH48o+op19U=; b=AxttyQyMRpmc1jz8yfH0vlOJDA1VKtjrgAMQ08rYFKOACMTXC7zM3bGthmZuaQPR3r MnH7ZTlG/rkDBi3/K01+8YtiBlChTk7treElcRqYszdurWUzDBPoNWx3QfWArtXcGv5f YYf1/sRdhiQpI/0jPQls9CNh362JyYWGUzfEEijyCzvrd/xW45H4ZHaCZHIcmfqDAsLT pxezrQSL21qu7v8oMu8buc3KOee/2HfEHgSZ91UjjBbIHaZiw7pk0uq9C6hMBHc29LfP Cp1WKAdsn/XsewyK1hC6ukgETwCcCsNqSIt6TcU2cPjTdMbbWp9uO6tNEZoteddKFd+W pxSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HToKCqE5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a170902d54e00b00183f6ff535dsi18272977plf.490.2022.10.19.05.34.16; Wed, 19 Oct 2022 05:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HToKCqE5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231564AbiJSMVV (ORCPT + 99 others); Wed, 19 Oct 2022 08:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbiJSMTy (ORCPT ); Wed, 19 Oct 2022 08:19:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFCEE18C427; Wed, 19 Oct 2022 04:55:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CD978B8246E; Wed, 19 Oct 2022 09:02:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B9A1C433D6; Wed, 19 Oct 2022 09:02:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170177; bh=DmgTEDOjY1ekANe0B6+eltI6M8iO58ZnFGi/+ktAkkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HToKCqE5MoniIQ1KWcQZtHC2Hni4vj2TIzaYuTUUhboellTy+FCHTmZjpTXfMWxAE AC9qS33+ZE04zfYGqZGD1FsqctEzkG2G6sHGka7Dpe5+qQKSHrJ4qJ/YwPmMN5sGiM YS6WUWFCV1yYd6pkrtol18VLNHidYDwH7A0cCzKk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus , Liang He , Sasha Levin Subject: [PATCH 6.0 555/862] usb: typec: anx7411: Use of_get_child_by_name() instead of of_find_node_by_name() Date: Wed, 19 Oct 2022 10:30:42 +0200 Message-Id: <20221019083314.503826672@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747119370822682074?= X-GMAIL-MSGID: =?utf-8?q?1747119370822682074?= From: Liang He [ Upstream commit e45d7337dc0e4f7f1c2876e1b22c71a544ad12fd ] In anx7411_typec_switch_probe(), we should call of_get_child_by_name() instead of of_find_node_by_name() as of_find_xxx API will decrease the refcount of the 'from' argument. Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support") Acked-by: Heikki Krogerus Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220915092209.4009273-1-windhl@126.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/typec/anx7411.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c index c0f0842d443c..f178d0eb47b1 100644 --- a/drivers/usb/typec/anx7411.c +++ b/drivers/usb/typec/anx7411.c @@ -1105,7 +1105,7 @@ static int anx7411_typec_switch_probe(struct anx7411_data *ctx, int ret; struct device_node *node; - node = of_find_node_by_name(dev->of_node, "orientation_switch"); + node = of_get_child_by_name(dev->of_node, "orientation_switch"); if (!node) return 0; @@ -1115,7 +1115,7 @@ static int anx7411_typec_switch_probe(struct anx7411_data *ctx, return ret; } - node = of_find_node_by_name(dev->of_node, "mode_switch"); + node = of_get_child_by_name(dev->of_node, "mode_switch"); if (!node) { dev_err(dev, "no typec mux exist"); ret = -ENODEV;