Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2110053pxb; Wed, 9 Feb 2022 11:03:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzldr8dELVqROaZa4g2wJwbVIb2d6K1OIhDTE5sA9hDnItlu+9JRYhtT4DND9GYHcM70f9r X-Received: by 2002:a17:90a:ad81:: with SMTP id s1mr5019964pjq.194.1644433404584; Wed, 09 Feb 2022 11:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644433404; cv=none; d=google.com; s=arc-20160816; b=aMpFDrPOsFm6rG+jVksR6Hf/Fh5I+rP9FJjllE3hUxfBtj0ysE4v5oJrBpDKFZpHKD 7msT5nxhLLZsx/7VOufnPWQdCp08L9uuNUHu3AgFV2yS8UP+73fLocxYorsku7+0ptnI vvLQbHX6SsVL7O798XYOxWkzWtKVJmHpSDd4dau0q2sVSCdU9ncAMC1Hb9G+rZ4bAdei BgEb5GDHF+aAQuW7359qWe1shkLtBg88cwVoFaeUvXWZrC7vQGNzJNZwNJ1p4aZ6db2m Fs0qya9HXSgA76Z7uf8HNQecmDtmt6W+rYUk5BnrEYasu71sepi/TJC7Z6M/Sd+AtZRv Lvaw== 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=iYb0ENCyRXUgcKmTLP8nEQL4yL3Qe7lBbJ2Pb+Opzlo=; b=qKAfnwfNDd03N5HffApU+91n0QaAigd/aD2fJ6o9CSm5XnRziPcr4O66lZDbniDtut U0CDdYWn6uj1w3GJdRz/mj4XOF4AXAiXAJHWA6Uj5hl+7nftd7znDieufOgDWM5ktS7w p8PLuRhPi4ONuIZtv39rIz2S+TMbEPaqCBtWA/3sPts4NVivFLr95ZvUuxM6daFx+4TG lsVjYrV737icnNDPlZb2O1WB7Pn1+0HEMvXGRIX2HjZrveKzaJnMpENwypxMirxtQdxW JOlml6BN20VkYiUsTJC5xubPIOGbaGMu4ON5IvA4ad2WDM5L2v9Yj8qX3+SXn7rhlQPf bfSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=prVn7lvZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w68si5622223pgb.228.2022.02.09.11.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:03:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=prVn7lvZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 588F8C050CEC; Wed, 9 Feb 2022 11:03:07 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237185AbiBIQdU (ORCPT + 99 others); Wed, 9 Feb 2022 11:33:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237083AbiBIQdH (ORCPT ); Wed, 9 Feb 2022 11:33:07 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BF66C05CB87 for ; Wed, 9 Feb 2022 08:33:10 -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 4249A223F6; Wed, 9 Feb 2022 17:33:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1644424388; 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=iYb0ENCyRXUgcKmTLP8nEQL4yL3Qe7lBbJ2Pb+Opzlo=; b=prVn7lvZnIJqGf5WBUK86fnd8CVzCXHIitZvO1IDYALHUaPnm72yZkT8etQ4e+s27bg8wI 5mm5cG5YnsZ3BPeL3cBjaMoSdBM2P2i+SKl0Vo5/SK3h6zHMBqviOFM/O2m8z+mFj81EqU 0Sl1rwvZmyVUTv1YaQYq/L6N/BJunLA= 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 , Dan Carpenter , Michael Walle Subject: [PATCH v2 5/7] soc: fsl: guts: use of_root instead of own reference Date: Wed, 9 Feb 2022 17:32:40 +0100 Message-Id: <20220209163242.430265-6-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220209163242.430265-1-michael@walle.cc> References: <20220209163242.430265-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 --- 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 f992064a7f58..13d07cc19f45 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