Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp202646ybv; Wed, 12 Feb 2020 22:27:04 -0800 (PST) X-Google-Smtp-Source: APXvYqy8eCytE2pBd9G6LnzoJgkD8wFeQtnZBJrOhwXgkSbEeTp4PAWRzT3p5EDRTJyjCYm8Bh7S X-Received: by 2002:a9d:4110:: with SMTP id o16mr12268788ote.101.1581575224297; Wed, 12 Feb 2020 22:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581575224; cv=none; d=google.com; s=arc-20160816; b=LFFoN/AuHZhmymuLiy2MdrhOaB2Gfmj04UfwDTGZX4kSGrbTt2pcoQmqmMMLVNZ+1w EJR4n++LpWBsHNI+H67khtbpVoSkZ7738GAnm0Ha+zwTYR8DhdYlwz4BvGLEMqZUEoGV B2w0vO4xHicQJ6TJPETLgCbz/zq+GjUxQIccZNuxXUccrx3kRjvPOksJw0l/NzlPASc9 H1jZXtEWvJwLmEckt2sMmBM2JbijR0zCUme5wk8onwIUjSNGiMv+oyIlI6N8FwThARho l2T7YjFEUNxB5TRYnIo34pP29TYdrOHwyHtg9IeWiP09m/sFldxsTcl8JmagObkGFDLD ZiDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=BtfWh232gygs1sDIPR9ppCkKjHiJa5bVM1MjfQwjjiY=; b=DWheY3q1xNcKIORop+dJK5B760EmYda/QgUqL3M+6SGObJdNJd+v0KiYqAWl16x7Na CNPL4RmGZgBvN3lp0ctZFz0ys2FI+wWvU4x62NYL705x3i6ICiDjhWFeTSnSPMpxJACo yzVCSlodnrltCMFPk4ueDDiP6wtD1fTFHqESJikZda9Hb2zCD9isdgENEZ2eyJJJjSIN /yjN4KuuIk/g6Ryh3SrnHwMvDXhix19OPGdF6clzGWlPhrA1T1IAg/xECfvz2vPgpKEZ jBr0gf8BRh3p0iKdK7aXn6J1hEnq5t6XF8nEYqI1fgFf1VNtt7jmwKcgA8N8/LRnkILM kU6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si731369oik.46.2020.02.12.22.26.49; Wed, 12 Feb 2020 22:27:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727123AbgBMG0l (ORCPT + 99 others); Thu, 13 Feb 2020 01:26:41 -0500 Received: from inva021.nxp.com ([92.121.34.21]:54430 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgBMG0l (ORCPT ); Thu, 13 Feb 2020 01:26:41 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6385322642A; Thu, 13 Feb 2020 07:26:38 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C0FC5226431; Thu, 13 Feb 2020 07:26:28 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 85BB240297; Thu, 13 Feb 2020 14:26:17 +0800 (SGT) From: Anson Huang To: linux@armlinux.org.uk, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, allison@lohutok.net, tglx@linutronix.de, andrew.smirnov@gmail.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, rfontana@redhat.com, sakari.ailus@linux.intel.com, bhelgaas@google.com, dsterba@suse.com, peng.fan@nxp.com, okuno.kohji@jp.panasonic.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH V2] ARM: imx: Add missing of_node_put() Date: Thu, 13 Feb 2020 14:20:54 +0800 Message-Id: <1581574854-9366-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After finishing using device node got from of_find_compatible_node(), of_node_put() needs to be called. Signed-off-by: Anson Huang --- Changes since V1: - correct some of_node_put() place to make sure it is safe to be put. --- arch/arm/mach-imx/anatop.c | 3 +++ arch/arm/mach-imx/gpc.c | 1 + arch/arm/mach-imx/platsmp.c | 1 + arch/arm/mach-imx/pm-imx6.c | 2 ++ arch/arm/mach-imx/pm-imx7ulp.c | 1 + 5 files changed, 8 insertions(+) diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c index 8fb68c0..5985731 100644 --- a/arch/arm/mach-imx/anatop.c +++ b/arch/arm/mach-imx/anatop.c @@ -135,6 +135,7 @@ void __init imx_init_revision_from_anatop(void) void __iomem *src_base; u32 sbmr2; + of_node_put(np); np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-src"); src_base = of_iomap(np, 0); @@ -152,6 +153,8 @@ void __init imx_init_revision_from_anatop(void) mxc_set_cpu_type(digprog >> 16 & 0xff); imx_set_soc_revision(revision); + + of_node_put(np); } void __init imx_anatop_init(void) diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index b5b557f..07f1972 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -282,4 +282,5 @@ void __init imx_gpc_check_dt(void) /* map GPC, so that at least CPUidle and WARs keep working */ gpc_base = of_iomap(np, 0); } + of_node_put(np); } diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index 2aa2692..cf4e933 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c @@ -109,6 +109,7 @@ static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); dcfg_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!dcfg_base); paddr = __pa_symbol(secondary_startup); diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 1c0ecad..dd34dff 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -655,6 +655,8 @@ void __init imx6_pm_ccm_init(const char *ccm_compat) if (of_property_read_bool(np, "fsl,pmic-stby-poweroff")) imx6_pm_stby_poweroff_probe(); + + of_node_put(np); } void __init imx6q_pm_init(void) diff --git a/arch/arm/mach-imx/pm-imx7ulp.c b/arch/arm/mach-imx/pm-imx7ulp.c index 7b2f738..2e756d8 100644 --- a/arch/arm/mach-imx/pm-imx7ulp.c +++ b/arch/arm/mach-imx/pm-imx7ulp.c @@ -62,6 +62,7 @@ void __init imx7ulp_pm_init(void) np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1"); smc1_base = of_iomap(np, 0); + of_node_put(np); WARN_ON(!smc1_base); imx7ulp_set_lpm(ULP_PM_RUN); -- 2.7.4