Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp291505ybv; Thu, 13 Feb 2020 00:19:20 -0800 (PST) X-Google-Smtp-Source: APXvYqydqolRLavQvf5pqfagWHi94G6LSTlqVIX6t13L7oAtGrSpQy/s5mRW5OOgWsV6wkPMgXvn X-Received: by 2002:a9d:d0b:: with SMTP id 11mr12977933oti.287.1581581959906; Thu, 13 Feb 2020 00:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581581959; cv=none; d=google.com; s=arc-20160816; b=00iqjS6zl+Bq6MF/Dw3T1ZQmGDd8QBfXFb4FPN7blyWSoi2GjTLFemB4oEIF64+n/4 pUXIhHzq+4RhDzw+fh3G0dtD2eHxjMgpoXvbEfhSN5vaU/JuPGtU6lRNIaLteQQQoqyF h3D7w0D9YLH3iWAQh5zJ7nsJ3mBYsVbQIBRbM9c7quz30TscuLhS6JDjbBHySbPJCOGf BGo24tu0bGdE4Xff7SMef8fG0T4keCUAxYc8ULGq/SdQxXapP2RCWJ8g+QT8WkMrPyRz uGFHMGCCoYfQ5gJ4+rcic3SZ+4NhY/0y/WaI3qDjXOwcvFuwj47g5ZiL7z5xgLhRvdZ7 L/rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YkEHnef+NQEICs0Pq0dOve/swl4DKSBk2bJOkbqxEY8=; b=IKOAG8sunTPmlBoObFPmOAGzPnB38YtXje99qd3v1O3IpjEGmR1m15r30RpwiVWD3C WrqrXFtzUxDn+G1PBjp5jDPLIHcgJ+5Py/+9C+jcINbfWVz2TmC6Xtzw43qwTkGT2YL+ M/t6g1mtF1odjb1veHl1xUvjwan4gt3TTHfqAG5u2qvHncF8MGTpERx2f+zHfh6el38U firOEuDFAV18B/K8GeD2aW56tYrFxWr8RpIVZ66q8kmHJSz2BzngoUC3VVDX1P4KxXV6 0MGvqhKSxSjbYuQqhKw88liCL+GzAlsPZFrqDhtIKaeFB09GTTwxIc2Lp3kxe6vtG4Uf 0vYg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e23si889531oie.105.2020.02.13.00.19.07; Thu, 13 Feb 2020 00:19:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbgBMIS5 (ORCPT + 99 others); Thu, 13 Feb 2020 03:18:57 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:49005 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbgBMIS5 (ORCPT ); Thu, 13 Feb 2020 03:18:57 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j29hh-0001zY-Gy; Thu, 13 Feb 2020 09:18:33 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1j29hZ-0005R6-5H; Thu, 13 Feb 2020 09:18:25 +0100 Date: Thu, 13 Feb 2020 09:18:25 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Anson Huang Cc: 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, Linux-imx@nxp.com Subject: Re: [PATCH V2] ARM: imx: Add missing of_node_put() Message-ID: <20200213081825.mox35tzizscdk7km@pengutronix.de> References: <1581574854-9366-1-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1581574854-9366-1-git-send-email-Anson.Huang@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 13, 2020 at 02:20:54PM +0800, Anson Huang wrote: > 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); > } It would be a bit more natural here IMHO to introduce a second struct device_node * variable for the fsl,imx6ul-src device. Then each of_node_put would belong to exactly one of_find_compatible_node(). (Now the of_node_put() in line 157 frees the fsl,imx6ul-src on i.MX6ULL and fsl,imx6q-anatop on the others.) The other hunks look fine. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |