From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E75BC02194 for ; Fri, 7 Feb 2025 02:00:22 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Ypxxw74L7z30T1; Fri, 7 Feb 2025 13:00:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738893620; cv=none; b=AblRyUU3rAxcimMXz+Qc64N9x7xeuIyIau5ZMF3LPOqnjcqYgHF5us+zISiskpZ4OxBe3PfrbixCeIaHFpAbz2uJG/JhM2Xq/NbZcMcQpQNBtPtThtcV48bEHvN0FJAXIFgm6TA9YpJYfHZ2eGZCKAUJqahiq+huqpaURWpgBH9pHQXLt9gAgyXW6QJmMaTOoFL++xJDlxk4UnPnswz/lCL6bNlvMtI6LeWf5BvhlwcrjGhB3tDFpCUba/Y1j/8VQyb1Y5TueUWbt+9qcIoTUP/Ofk9Vbm4rPxDJj1+bsfiR3574RXCcUMPNS2B9Zx1HR/s7K8U0OSUvyB4IEY9M6A== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738893620; c=relaxed/relaxed; bh=p4mWCtrk7n0Ch1AiiJ9Uk6VD8300/kQGSsE6469uRzg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cMknIDoIME44a4LpGIEe/4Vw0f1BV1+Qvo2JWlpRCQ3DGijAP8v+OP+XWKbr/yyRRC331pGNzgPt3HMSdH/+vHd2UuhNF8cB3xr9y8a0juILn3+mJBMlfJuXm1Fc3/UJu2VqNdN+yj8j1dM8JYRdOXH8E70NaJ2cHrXAAXSvuyflvhIgsjfD5U9zerRst2bKWra6QiQnzz7TT9oJ/DrREJXfl4yvSu3RQG6d3N6m25xXa/wNhoRnYlN+QLPCmOHeNSWd9aJOv2ahiKfY8cgJd+d38q9hD6ItZAR402dtb1+5yuLdO9AJ48DieLfflJwawnxOg1ellrth4kI4rS4p7A== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass (client-ip=45.249.212.190; helo=szxga04-in.huawei.com; envelope-from=zhangzekun11@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=45.249.212.190; helo=szxga04-in.huawei.com; envelope-from=zhangzekun11@huawei.com; receiver=lists.ozlabs.org) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Ypxxw1MyRz30Qk for ; Fri, 7 Feb 2025 13:00:20 +1100 (AEDT) Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YpxR24hwTz22m8l; Fri, 7 Feb 2025 09:37:02 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id A8ED714010C; Fri, 7 Feb 2025 09:39:49 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemf500003.china.huawei.com (7.202.181.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 7 Feb 2025 09:39:47 +0800 From: Zhang Zekun To: , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH 5/9] powerpc: Use of_find_node_by_name_balanced() to find device_node Date: Fri, 7 Feb 2025 09:31:13 +0800 Message-ID: <20250207013117.104205-6-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250207013117.104205-1-zhangzekun11@huawei.com> References: <20250207013117.104205-1-zhangzekun11@huawei.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemf500003.china.huawei.com (7.202.181.241) Instead of directly using of_node_get() before of_find_node_by_name() to balance the refcount of the device_node, using wraper function of_find_node_by_name_balanced() to make code logic a bit simplier. Signed-off-by: Zhang Zekun --- arch/powerpc/platforms/powermac/pic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 2202bf77c7a3..0619334adf2a 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c @@ -308,9 +308,7 @@ static void __init pmac_pic_probe_oldstyle(void) /* We might have a second cascaded heathrow */ - /* Compensate for of_node_put() in of_find_node_by_name() */ - of_node_get(master); - slave = of_find_node_by_name(master, "mac-io"); + slave = of_find_node_by_name_balanced(master, "mac-io"); /* Check ordering of master & slave */ if (of_device_is_compatible(master, "gatwick")) { -- 2.22.0