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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39623C32771 for ; Thu, 9 Jan 2020 08:16:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0D04E20673 for ; Thu, 9 Jan 2020 08:16:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nnABkFxi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="NFz7kL6R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D04E20673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Zhm+bAOi08gfGugB4aDg6tL4mue7HCh0oTWXTe0Q4zM=; b=nnABkFxitCxVmC CMXjvy6QvDW7iNko44NCgHMJANyWI3384dQSEYVm13EvhUoxhydqeKoRqGYsqTsOk4sBFGGOAmt54 2Mya28o6lUFbvXxAzL5ak5kV8lCXFgVCQaSEeezdiyaGUqK1ncsquv4AM4PEtmWdW+kvOJj1J+JBZ MOYp6oDEjdQCK7OO3QPXFqj4/Wt1X2swXVvBMFhn1CbvxSgT+TpfLmPRaGQCXuF/r0q9PRJNOUCQs KAYezPkGEv1aK2rx9rL/acyCiBdfyuO4WMNU3Zxw4CGK/cZS3QltCV1H4L+eLbcyzdcDPV7me0456 Wgb9cx4KlRBxR/TFz3Pg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipSzJ-0004lj-Fa; Thu, 09 Jan 2020 08:16:17 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipSzG-0004lC-HS for linux-arm-kernel@lists.infradead.org; Thu, 09 Jan 2020 08:16:15 +0000 Received: from T480 (98.142.130.235.16clouds.com [98.142.130.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C15520673; Thu, 9 Jan 2020 08:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578557774; bh=Ig8MmN3PyaZFfhXHd04xYCXqXztbORRcP6mk3OMhKnY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NFz7kL6Rli3iJa2zYrYYlZjt0VSUQ22isIyA1VxMG6wKcYMCe9VLNckYhxRwGBMgT 1+2m7RK5AwqLAeAyhcahD9ZLmVyatAKzjUAImqCGlgTxcpaOX7F96TpFYmGpLVAPZw 5hifcxbkywB4paXwMHunnTBrONed5/gDHLO1M5Hw= Date: Thu, 9 Jan 2020 16:16:04 +0800 From: Shawn Guo To: Peng Fan Subject: Re: [PATCH] ARM: imx: use of_root to simplify code Message-ID: <20200109081603.GI4456@T480> References: <1577696316-27635-1-git-send-email-peng.fan@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1577696316-27635-1-git-send-email-peng.fan@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_001614_603964_77E5618D X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "cniedermaier@dh-electronics.com" , Anson Huang , Alice Guo , "s.hauer@pengutronix.de" , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "festevam@gmail.com" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 30, 2019 at 09:03:51AM +0000, Peng Fan wrote: > From: Peng Fan > > start_kernel > |->setup_arch > | |->unflatten_device_tree->of_root ready > | > |->do_initcalls > |->customize_machine > |->init_machine > |->imx_soc_device_init > > When imx_soc_device_init, of_root is ready, so we could directly use it. IMO, of_root is something for OF core code, not really for platform. Shawn > > Signed-off-by: Peng Fan > --- > > V1: > Tested on i.MX7D-SDB > > arch/arm/mach-imx/cpu.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c > index 06f8d64b65af..77319b359070 100644 > --- a/arch/arm/mach-imx/cpu.c > +++ b/arch/arm/mach-imx/cpu.c > @@ -88,7 +88,6 @@ struct device * __init imx_soc_device_init(void) > struct soc_device_attribute *soc_dev_attr; > const char *ocotp_compat = NULL; > struct soc_device *soc_dev; > - struct device_node *root; > struct regmap *ocotp = NULL; > const char *soc_id; > u64 soc_uid = 0; > @@ -101,9 +100,7 @@ struct device * __init imx_soc_device_init(void) > > soc_dev_attr->family = "Freescale i.MX"; > > - root = of_find_node_by_path("/"); > - ret = of_property_read_string(root, "model", &soc_dev_attr->machine); > - of_node_put(root); > + ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine); > if (ret) > goto free_soc; > > -- > 2.16.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel