Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp430610pxb; Fri, 28 Jan 2022 02:17:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNOgvPeclhhcgHai9KueJqFGtlR7RoYX03N4TyNIbOzrEM5IFheaGYvgD2kV0BytAfgRj4 X-Received: by 2002:a17:902:d4ca:: with SMTP id o10mr7562007plg.29.1643365079776; Fri, 28 Jan 2022 02:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643365079; cv=none; d=google.com; s=arc-20160816; b=Jw4m4We/EJIgg2xkPpbTtXEDc45K927P4VXn6uQCkiPcfsX/FBX+oVSmoAjWNDiLKV P09bPAY08zoByfZeQeKo9U82TngSmLLBqmxsXHQ+ugxskOJGN5INbdMlj26HzdiXMoD6 cj9LKwVTYfw1Qt33aOmIxoI5CCDv8nyIdr5WKSpRAJjOD79rikNSIMKjyGmn8yt6qYPT KA3DNy7fuqAj0DBeeHzloNYKyLcpS+DmlvskKcxGPLeEyS0RFLOQNmYZpndWgB9QOzeS gcNuPT+NVyvWg3jabcqCaO1jqbEr8L9wybktoirGKx9JpVEdXSQ0cRxl+eKOKrAlpVaQ 7+/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AHaJAinHemm5iRDWpfuIj9kw7+KTQm29ecIVsTXxKjs=; b=PQGtiFQOEkdTqhZEQHR+Cw6p44cgqLFpZPcVU519LcI6g0YV7aTJySbpQNNf+2/tJT Uf1cR8mI3Nc4I5DpgDEoJqAVfMpYpGAmM4EEWeyL72bsm7NBpbHv9KoUNVAgSSFHMSng TNlPH8eS0XbOhrj0OSpQxiUs8XpWE49BCMzGCpokk7nikd8xEP9VCVUGEClZbGGzSw5e wyViBGtLTmjCvFwqnMaPlV/EryNfwjEoYwxiIR44Tjj8Eyf+cfvCCDqBFPS0CZEAcqiG S3vXzwUMNvgXnF4c7yPNkZoAwma0un54qG85WaBjVGthoV8mdzhbbEK+XFQHfiXYpq3k u8/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=F7yKqrGZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si1065656pls.162.2022.01.28.02.17.48; Fri, 28 Jan 2022 02:17:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=F7yKqrGZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243990AbiA0Qlx (ORCPT + 99 others); Thu, 27 Jan 2022 11:41:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243939AbiA0Qlo (ORCPT ); Thu, 27 Jan 2022 11:41:44 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28C0BC061714 for ; Thu, 27 Jan 2022 08:41:44 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 9276A223F6; Thu, 27 Jan 2022 17:41:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1643301702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AHaJAinHemm5iRDWpfuIj9kw7+KTQm29ecIVsTXxKjs=; b=F7yKqrGZDCDek0hxXpXT3UcQKugR1pGyW00yqOitChlarkF3IgCXxFeQx2dQ/QLW6Aucae 32PLsWjj7TaXC6KsqDkEaoZmjR9oEnOzYhv1d2Btlcja4halKLqu0x+CIsp7SZen2tz1TE i2NyIouSHPer/hRaIDFam021ONxDRqA= From: Michael Walle To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Li Yang , Ulf Hansson , Sudeep Holla , Arnd Bergmann , Michael Walle Subject: [PATCH v1 5/7] soc: fsl: guts: use of_root instead of own reference Date: Thu, 27 Jan 2022 17:41:23 +0100 Message-Id: <20220127164125.3651285-6-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220127164125.3651285-1-michael@walle.cc> References: <20220127164125.3651285-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is already a global of_root reference. Use that instead of getting one on our own. We don't need to care about the reference count either this way. Signed-off-by: Michael Walle --- drivers/soc/fsl/guts.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 383b35a4ed58..04c3eb6a6e17 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -112,7 +112,7 @@ static const struct fsl_soc_die_attr *fsl_soc_die_match( static int fsl_guts_probe(struct platform_device *pdev) { - struct device_node *root, *np = pdev->dev.of_node; + struct device_node *np = pdev->dev.of_node; struct soc_device_attribute *soc_dev_attr; static struct soc_device *soc_dev; struct device *dev = &pdev->dev; @@ -139,17 +139,13 @@ static int fsl_guts_probe(struct platform_device *pdev) iounmap(regs); /* Register soc device */ - root = of_find_node_by_path("/"); - if (of_property_read_string(root, "model", &machine)) - of_property_read_string_index(root, "compatible", 0, &machine); + if (of_property_read_string(of_root, "model", &machine)) + of_property_read_string_index(of_root, "compatible", 0, &machine); if (machine) { soc_dev_attr->machine = devm_kstrdup(dev, machine, GFP_KERNEL); - if (!soc_dev_attr->machine) { - of_node_put(root); + if (!soc_dev_attr->machine) return -ENOMEM; - } } - of_node_put(root); soc_die = fsl_soc_die_match(svr, fsl_soc_die); if (soc_die) { -- 2.30.2