Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3511965pxb; Mon, 4 Apr 2022 19:22:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSl4aLB7SpoN5YWQyZVxNgWnEC4X+FX3aGZxA+s+35ktaSzuHe82lj/JKToPlfpo0FRP2B X-Received: by 2002:a63:8441:0:b0:398:5cf2:20c0 with SMTP id k62-20020a638441000000b003985cf220c0mr919284pgd.591.1649125378488; Mon, 04 Apr 2022 19:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649125378; cv=none; d=google.com; s=arc-20160816; b=hmCkY/XACcxF3SI0I6mvvoqTOaVtNJluN0Ig5t0lt+ZcHo5wJ9p4dFrRQNsjwak5NA rCF8Jd/13t+7KU5etjf2CiNgxw7UAHfo7zjpU7rLeyaNQ6JG56xbuwCJj3zPHdZLnvi5 rtVSTPRzR53haK6I9KzzcLty9hqYQ1+ty3pLZNl/gfBtJrWmdlMoZ5ZwXk6jUtMhxvIW rrn0k3LiVLThtHSgTlx+QozoV4L3/cwrwzoiwTsaT4j1uzFaBS43IAJd5swX9ATRIjYS RoZMtehU+sLvm+B8wzqlJ3JuGXn/BHNdSFq2QUwBBLwYd9cJm137RrzttsaZ5uPWrave 3nAQ== 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=JnHccvJSwDHKIeM+KqZd1CR0E/ptqx04WpY+j5SqzI0=; b=l8IMtJxqFUawP08/ro+963iT5Ruisz4MHgxFmVdSabRfaly8mlQcj6ObZiJo6KHV1o ofctaIlsCqiTpJ4UvJlQ8kH9LxP39ddXC97DB2EPRO1UUj/N0CBLIg/OHA/zW1p//8QU 27GYvyHRJIPnY+/qAHgLmsu7roOBsIh9l8aLp1uD1O40Y7HCxbs+uhNHjarLOYTe5U0m Fgi4SaiZnNiSgdPqnmUQ89/9YTzR+/ml9p7pQrfkMnGESfKI3tJu8ZU+3Om2x4eYdtaV efqALvnu/+2moBuFX2VYLe9SyFIDlcL6zA4bd8WNP78Gh3BoqamrOwdiz3KuaHAFYU4H qBFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="RIWIC/8M"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p12-20020a170902e74c00b0015495894d28si12284959plf.412.2022.04.04.19.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:22:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="RIWIC/8M"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C33262B2B73; Mon, 4 Apr 2022 17:44:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355521AbiDDJ7k (ORCPT + 99 others); Mon, 4 Apr 2022 05:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355064AbiDDJ7X (ORCPT ); Mon, 4 Apr 2022 05:59:23 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE1DC3C48A for ; Mon, 4 Apr 2022 02:57:27 -0700 (PDT) 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 76ED72224F; Mon, 4 Apr 2022 11:57:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1649066245; 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=JnHccvJSwDHKIeM+KqZd1CR0E/ptqx04WpY+j5SqzI0=; b=RIWIC/8MFZvPuth+ebs52ym33tr+V1nZ8MKXpuiRD2eBIzJLBHLwEwDjbSwzl6xjGLvdI4 17W9loR0aWN2rCExu9XpS+bcZ4UmkeuBV5+57xjxAIJcidq+v4S284h1KOgdRGdIh8XyqW kvrUAvnowJHu04z4wA1Kcz1ajVb/GGY= From: Michael Walle To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Shawn Guo , Li Yang , Ulf Hansson , Sudeep Holla , Arnd Bergmann , Dan Carpenter , Michael Walle Subject: [PATCH RESEND v2 5/7] soc: fsl: guts: use of_root instead of own reference Date: Mon, 4 Apr 2022 11:56:07 +0200 Message-Id: <20220404095609.3932782-6-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220404095609.3932782-1-michael@walle.cc> References: <20220404095609.3932782-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 Acked-by: Arnd Bergmann --- 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 44e7a9bf6392..585cbd9d8224 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; @@ -138,17 +138,13 @@ static int fsl_guts_probe(struct platform_device *pdev) if (!soc_dev_attr) return -ENOMEM; - 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