From patchwork Sun Dec 18 14:26:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13076045 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 74E4EC4332F for ; Sun, 18 Dec 2022 14:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eVz06F1568BpQYVfxsaTVIpBQ1QmLtF+t9Mf07wrpFk=; b=erRGH4KvNnTF2I UcnvaPNeoRKkXszYX92kzzGiWkdBhi0q6zCChRgdRf2XTc9Crd96bWaDd0dU0iwskwreY2EjfWIlT /jAX9n1mtvmX5vSOM9lrHWn3wPDPWk6T9na8/limjB/9cT7TMzdbzPPUOEiLw2zhDv/w1a7aQFIat AqMbRmjBLe4Z1LfBIyzo4eiRS7a0iDTHlT7ZnBeadDWlQuRGyzQDSBMuW86IRudP1rXNlExk0hhNM ubkLipaHdRLa0yXCDWr/2HgTcPCnCShoUpaitNPEpUm/YNi+ptOtQAxpVD7+pvJ/pAELzErXRaoIa I1+OyxgeWUwV3keLy2Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p6udb-002At0-HF; Sun, 18 Dec 2022 14:27:35 +0000 Received: from viti.kaiser.cx ([2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p6udJ-002ApW-R7 for linux-arm-kernel@lists.infradead.org; Sun, 18 Dec 2022 14:27:19 +0000 Received: from dslb-178-004-201-210.178.004.pools.vodafone-ip.de ([178.4.201.210] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1p6udH-0007F2-Vr; Sun, 18 Dec 2022 15:27:16 +0100 From: Martin Kaiser To: Andre Przywara , Russell King Cc: Martin Kaiser , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ARM: highbank: fix of node handling in highbank_init_irq Date: Sun, 18 Dec 2022 15:26:47 +0100 Message-Id: <20221218142647.394881-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221218142647.394881-1-martin@kaiser.cx> References: <20221218142647.394881-1-martin@kaiser.cx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221218_062718_084643_E0DB3BF5 X-CRM114-Status: GOOD ( 10.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org highbank_init calls of_find_compatible_node and discards the returned node. We should save the node and call of_node_put on it when finished. Signed-off-by: Martin Kaiser Reviewed-by: Andre Przywara --- arch/arm/mach-highbank/highbank.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 97ccb8c1b3cd..54eb1422ef8f 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -50,10 +50,16 @@ static void highbank_l2c310_write_sec(unsigned long val, unsigned reg) static void __init highbank_init_irq(void) { + struct device_node *np; + irqchip_init(); - if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) - highbank_scu_map_io(); + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9"); + if (!np) + return; + + highbank_scu_map_io(); + of_node_put(np); } static void highbank_power_off(void)