From patchwork Wed Sep 5 19:37:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 146027 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp5340228ljw; Wed, 5 Sep 2018 12:37:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZBskSJI0xcB7CS6S9k1dB6YOfJATJSV6q5/bYZvR6DR284xaLdCobOkm82viNduXiI4RJc X-Received: by 2002:a17:902:1c5:: with SMTP id b63-v6mr41195645plb.82.1536176274785; Wed, 05 Sep 2018 12:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176274; cv=none; d=google.com; s=arc-20160816; b=0C4Gq5P5ASJcXrcTqfnXQdtdPSX+s6rJqLZc1mbyzLkgD/nDlBjsO2cq6zMW8knen5 4iSdhRorDDZCCAnsrluzxX50Acb7bhlCpBXW8LVTtLiS/BHaNfAJLKnicfyU90383/rW 2v3ahSiGk/9JwOHQOJgcoarwjhTCJQhznzVOSOMNQwMvazdk9QcoZvp2VUiE8BNJhCCr gyDG0EfOilB0ZDrg+whVLFKd425gQ+3Ez4m2Z2cSCyE1hwP+Kx9NodfRqLgI7i5WIVRu dlbz8aGDk8tqGrkAzVw0rPbkuZGip0kkD8A7eY+B9QOmuseRzzCs2OPLVb4w4E5RfEib dd6Q== 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 u64-v6si3001007pfd.297.2018.09.05.12.37.54; Wed, 05 Sep 2018 12:37:54 -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 S1728108AbeIFAJ3 (ORCPT + 32 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(-) -- 2.17.1 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