Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1480imm; Wed, 5 Sep 2018 12:41:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYqQvz9ezoWexgp+/mgK/UGaio01++ickbSd+jsy5qJ+l7H1F/WwOQS69kP75oSA+mgTh+V X-Received: by 2002:a62:49d5:: with SMTP id r82-v6mr42142452pfi.245.1536176489450; Wed, 05 Sep 2018 12:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176489; cv=none; d=google.com; s=arc-20160816; b=NCErl6vIHz/Fkklm7gM63bitVNMuzEAJlWS7qdaEeO6pnNW9gFQJe5ia17uGEqub1q ZX8qUAgQTjlJLnF5zm4y+aBQcvrgQS0sPia4Di01KbduxzvpxXS+3QYf1hCQzuKIutZb w+T1EAcwPxw1z5FbHTRGPH+qxglDYfHEMBMwQ2u/4DhnyD0y0q0jyi9lpx0Gf0JM8aoQ TvpjBz+yD8ed6KrbdQL8HIsPROmmTPv6m/KfyOkvhnd+YBOSe8I4JIXjr4nY+msw0o6Z Y0HNsxgGcsWI+Ge5P4ZlLy+USWkw7Y7jrgzFgNkLFjZ/y7LFRjeXijNB373j8rwS5OlO IDjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Jrg1zbMesAMdjnvTSH+V43cpguLxHWMPgV4Z9iIWt8s=; b=bgTU4gWqiwIAkXyn59XPIPFLxEzPIPqvbNrLvTyXhz4TaitC0FN+fHAnkECfJm1lUl xBOuYXedIM2jGtziC+RGg0kaUKtmn/TYh3qaq9BA36yGdPuvjkt8+UUH4vtZ+X7MliwN 9PFqvQ72QybcqgaUaB8E4UcpnwIcuyOVNVnpofFTdSjzNWPHm9GKOfw6gl6wGDxVX229 QzOECh6/aVWhHZOuOrwdlEcZrLJXh8y23PH+IJcX5gisbVC1+29Csm/EyveQTlZ5szki pLXKGz4xQSbhbc9jxExh8gzn10hDtYhmo0v9OLhhAf9hgMs8N2gPufRNXh/MIPUV+hZm D2GA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10-v6si3004037pln.161.2018.09.05.12.41.14; Wed, 05 Sep 2018 12:41:29 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728103AbeIFAJ3 (ORCPT + 99 others); Wed, 5 Sep 2018 20:09:29 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:46131 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728077AbeIFAJ2 (ORCPT ); Wed, 5 Sep 2018 20:09:28 -0400 Received: by mail-oi0-f67.google.com with SMTP id y207-v6so15870195oie.13; Wed, 05 Sep 2018 12:37:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jrg1zbMesAMdjnvTSH+V43cpguLxHWMPgV4Z9iIWt8s=; b=aFqzOloGM4RfxMM+ggBp5jeia2xvin7AZ7a/pj4fCNwXKh6yLcIu9dYrN6ChcjjrCo 0KmovKvizi6v7rVBE/bhAEZXxshjKXGTA4ZXzK5JyIdKILAGc6DV0DSU3PCcgUCi4W6d okexDvbLL7HMCF43VSlTI0iRSvG7yR1uMPuzULQcboStE15cwTC3b2Q1jOAAUUNDYPbH N8KiWW43nhvRLRO7qAtar8it70uUVQjGNM1QK6sR5+iTozHoB/AYBKiMfTow/BW9c/FH RSPM7RGLNHs4PHwjPmVnvhFdr/iJMWiVhH1B69g8JCUMZ4I19NThp6oNYjabdW8rz2rk fBhw== X-Gm-Message-State: APzg51DQBqlvYI3mXjamAc/2VaHC8+IAt6nJGSPaiacwZWDO6cNnUHqR p1o/RGDbE+CXOX8JUVvDJ/3Ks1Q= X-Received: by 2002:aca:5d86:: with SMTP id r128-v6mr7292755oib.243.1536176270404; Wed, 05 Sep 2018 12:37:50 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id u21-v6sm2296053oie.22.2018.09.05.12.37.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 12:37:49 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ley Foon Tan , nios2-dev@lists.rocketboards.org Subject: [PATCH 09/21] nios2: get cpu node with of_get_cpu_node Date: Wed, 5 Sep 2018 14:37:26 -0500 Message-Id: <20180905193738.19325-10-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905193738.19325-1-robh@kernel.org> References: <20180905193738.19325-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "device_type" use is deprecated for FDT though it has continued to be used for nodes like cpu nodes. Use of_get_cpu_node() instead which works using node names by default. This will allow the eventually removal of cpu device_type properties. Also, fix a leaked reference by adding a missing of_node_put. Cc: Ley Foon Tan Cc: nios2-dev@lists.rocketboards.org Signed-off-by: Rob Herring --- Please ack and I will take via the DT tree. This is dependent on the first 2 patches. arch/nios2/kernel/cpuinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c index 93207718bb22..ccc1d2a15a0a 100644 --- a/arch/nios2/kernel/cpuinfo.c +++ b/arch/nios2/kernel/cpuinfo.c @@ -47,7 +47,7 @@ void __init setup_cpuinfo(void) const char *str; int len; - cpu = of_find_node_by_type(NULL, "cpu"); + cpu = of_get_cpu_node(0, NULL); if (!cpu) panic("%s: No CPU found in devicetree!\n", __func__); @@ -120,6 +120,8 @@ void __init setup_cpuinfo(void) cpuinfo.reset_addr = fcpu(cpu, "altr,reset-addr"); cpuinfo.exception_addr = fcpu(cpu, "altr,exception-addr"); cpuinfo.fast_tlb_miss_exc_addr = fcpu(cpu, "altr,fast-tlb-miss-addr"); + + of_node_put(cpu); } #ifdef CONFIG_PROC_FS -- 2.17.1