From patchwork Wed Sep 5 19:37:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 146034 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp5340417ljw; Wed, 5 Sep 2018 12:38:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbPfb0dBUor70+4kT7nyV7Hh1HK0JC86y1hK7EXobY2fozb7xCV8+1AWJS6SBnEBHt9Lcze X-Received: by 2002:a63:77ce:: with SMTP id s197-v6mr38702235pgc.172.1536176286596; Wed, 05 Sep 2018 12:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176286; cv=none; d=google.com; s=arc-20160816; b=0zAZFf2DTGvs1FBGtl9tp6Wa0w3Z2bgc1GfMbVrbLNzo0fhZbYrASDLVeDrD7HbeLV 7XfgOrv6vQLAMns++uFm4ijnbCZoDEN5vOaISsHpSrXy6eiyE9ocSENWz80TdoEdeS6c BKP1YvBXh6BEvUnJZlTMdAgNvZKLhYS9fngQ9QREECDtZD9wpsjvBp9wA3KCiIP6n61R 041pk88PEZaPI37fV1O/bRcBjPf3haI9IXlPf/OD9mRiXziozHbkSNa0NO6j6XDVEn2h SIteNvlCK0C4oKX9NcaK7IFgztgZlvnurF/rqVccJuo8rpiPy3VF8PiF4pHgU2+WqZYI GzqQ== 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=XSLGQ9uqdAn4wTY6t09Z9k1WYMJrEeRcoehNp+zGb14=; b=Q+rjbu5sZ633FJ+MvJRW/ipiwztsp8112kvQAzqf8+kh8earDBdXjfyjwKoPeTSLe6 v6f0Bl8/d8UWyqpxiy1YqHBfgsk+YmjGnchtEkoaUdpcxnY0EE+G8D1ithPXx46XIUg0 lBjkfsRiJKXOL6PIqfpQ2XILL/Hbp3rU2TAn0ehJOKQYmi6/TcKquv1V80sniZzPit4y w4uVYd9xGfBV2j986dPEcr2dum5xBY4z31QN1yEGJHj2XxxLrBCYIiSyU1Embyq/2bzN /heYtt49ZnC8ZFsV/Ms4uIcfDfklx0Po3+QolTrsJ96ALlwc/FVBPunQClBfqP7XRrlg /m0Q== 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 a190-v6si2917004pgc.241.2018.09.05.12.38.06; Wed, 05 Sep 2018 12:38:06 -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 S1728262AbeIFAJm (ORCPT + 32 others); Wed, 5 Sep 2018 20:09:42 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:42571 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728237AbeIFAJl (ORCPT ); Wed, 5 Sep 2018 20:09:41 -0400 Received: by mail-oi0-f65.google.com with SMTP id k81-v6so15916221oib.9; Wed, 05 Sep 2018 12:38:03 -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=XSLGQ9uqdAn4wTY6t09Z9k1WYMJrEeRcoehNp+zGb14=; b=qOnEtPzxHa9mvw8XvkK4/zDt5kveZn+IfJIBlXQS8AHq9iAx5Vx8pFQxSbNTSuviaE hsCQgW/fEWchWRYMJ3ATA/HW7xr5pOTfg7zojNYjmwvTtYaJXq4tOB3y43A6P+iBahQE npg8XR3W30eh5HzxgnStOaPrBskRpljUytEFLMSNZzYhQDXq9fYZ1hCeNEAXUp2FeZu0 C9ZCMwRSDnj0VIHbXYafAfCka6r98TiZaph1IWcN6FTUoUbNr0S3628j1kYzmZ3vzTqO yAOP9Q/epiwiy/8O3tFlp5xdkZAsPNyyHpcTMKcM+o5cZNR2a5fyWtQdT4nKEt645ycI 1Rhg== X-Gm-Message-State: APzg51DPv/hSkJZ5XX+2Td1eRTFAU1sbm1OeS/uGf/gvY0anPXRhwjpH G6eyhOZZ/QTMclocbx4cwtaNQ+Y= X-Received: by 2002:aca:3fc2:: with SMTP id m185-v6mr31989616oia.240.1536176283327; Wed, 05 Sep 2018 12:38:03 -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.38.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 12:38:02 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Frank Rowand Subject: [PATCH 20/21] of: use for_each_of_cpu_node iterator Date: Wed, 5 Sep 2018 14:37:37 -0500 Message-Id: <20180905193738.19325-21-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 Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This has the side effect of defaulting to iterating using "cpu" node names in preference to the deprecated (for FDT) device_type == "cpu". Cc: Frank Rowand Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring --- Please ack and I will take via the DT tree. This is dependent on the first 2 patches. drivers/of/base.c | 2 +- drivers/of/of_numa.c | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/drivers/of/base.c b/drivers/of/base.c index 6389aeb2f48c..8285c07cab44 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -389,7 +389,7 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) { struct device_node *cpun; - for_each_node_by_type(cpun, "cpu") { + for_each_of_cpu_node(cpun) { if (arch_find_n_match_cpu_physical_id(cpun, cpu, thread)) return cpun; } diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 27d9b4bba535..f165fe28f49d 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c @@ -24,18 +24,9 @@ static void __init of_numa_parse_cpu_nodes(void) { u32 nid; int r; - struct device_node *cpus; - struct device_node *np = NULL; - - cpus = of_find_node_by_path("/cpus"); - if (!cpus) - return; - - for_each_child_of_node(cpus, np) { - /* Skip things that are not CPUs */ - if (of_node_cmp(np->type, "cpu") != 0) - continue; + struct device_node *np; + for_each_of_cpu_node(np) { r = of_property_read_u32(np, "numa-node-id", &nid); if (r) continue; @@ -46,8 +37,6 @@ static void __init of_numa_parse_cpu_nodes(void) else node_set(nid, numa_nodes_parsed); } - - of_node_put(cpus); } static int __init of_numa_parse_memory_nodes(void)