From patchwork Fri Feb 7 01:31:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Zekun X-Patchwork-Id: 863171 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id 260F818C907; Fri, 7 Feb 2025 01:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738892393; cv=none; b=opqKlBTheNkwolI2JJmhQhurxkaAs9pznk7IHlT2HPErdko3YrDXptq/rXJTLSWjFEOzzey8RmemQsjloQyYKHdDsQ03LGknzM3PDXR3j+BHSpOaD9jkmbL08ZxOGIHdZeb+89ZBZ32bGV+6L4Q8C+cjFxfzJ6WOuO2pbPoC8B0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738892393; c=relaxed/simple; bh=u6KVkOE4Dtix3HpVfbet9p/5YAPxwXqg9Ba7CU/Q/CM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GgylpyB9jagQrF+4IiDyXbzhYOKa6XVaIAM06G3X9bCqZxu5kyHlZu6Pksd55Ukw4YisVf73dffaTIwDzoIIPbaCO8NRyxyE0tk+MtbKdqjBi6fk53sGK6EVC4HKBUygJQmAuEvu2APphjdxaVQn9ogd/He8xAuG8vWggOefWJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com 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> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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")) {