From patchwork Wed Sep 5 19:37:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 146039 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp5341461ljw; Wed, 5 Sep 2018 12:39:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaBjCG8rRikyCY+CNt87+YBsxU/VE6h1MRmqOWhik8mRXjPtnhMjj/P/wBgMvV7LfdGoo07 X-Received: by 2002:a63:cd4c:: with SMTP id a12-v6mr38367952pgj.15.1536176352150; Wed, 05 Sep 2018 12:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176352; cv=none; d=google.com; s=arc-20160816; b=0WJzmSjPi0GnurhBRoElY8yDrAKamIjS/YhJVN41XkIn+BjUyFMJdyJwKXu6St2ojM XmZ6wHg46Y+ZBx0Jlx4pspcvSSK0dwq3TJPEdicIOG3Bwu0RqLcw7Hf+XnNDntaCFNw6 rgy10llCCa1Nn0Zb7224Jqy3iD0nTfRee7dMghibIUL3xFJDiz06boW77R/W55+ui3vf +Q1AKH7kYBg2obBmCS6/tAMwZQzMH2X4BUkbA1mfjzgO8DOtSN4hT6u614WUPvdrWBp4 Y15GJ3VV7XPUUoMgDZ/a3LY/BHSj3uY4dhzcWnJLPnsT72eyyUHfkkqNTsUTOF+l74Yg 5QDA== 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=w5y2GFORKjExM0nWitCpBSerVbpnpsUXlRB1soYRGOY=; b=emO/QIKNrjwFiLvzmdXPcPF+kbaX/DBcBJ/q/Z737x4ldsuGmrmuOiI9rAxy4FkW6E NhIWauLMY1FSuN6b7OQ1LchQXfwlbGqJDpqybJ2T+jpb4dprPuyshevNrCNytu9uWQdE oo7HKunByvjzFl5auF2zIwHQ77xh1CVSeTKZ5g3tB3jJAhd7J3iJxYRSOqp/SX/nqNOP UvAjjgRhUm0QTpPSM5rKV8PwTCFxF50QlQF2Kxhe0KB9nLq/8pwC7T8U9QjCCcmKuaAn YE5LOIYoQRbqdc1TdcbhLBg6a3EfZ35wE/ndO+CwwhK8OV1rThzw8ZYTYKF1bQJnUObo tSkQ== 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 i32-v6si2860877pgl.74.2018.09.05.12.39.11; Wed, 05 Sep 2018 12:39:12 -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 S1728331AbeIFAKr (ORCPT + 32 others); Wed, 5 Sep 2018 20:10:47 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:41611 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728046AbeIFAJ0 (ORCPT ); Wed, 5 Sep 2018 20:09:26 -0400 Received: by mail-oi0-f68.google.com with SMTP id k12-v6so15892501oiw.8; Wed, 05 Sep 2018 12:37:49 -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=w5y2GFORKjExM0nWitCpBSerVbpnpsUXlRB1soYRGOY=; b=kmNKlpEjpwGzBWAkvC9mBGWRpHPNtvEr3D8DwcVlKMRoiLIl+SGDnRkBzMWtm8qr52 dpIdn2Gi1XEFnHvPZycazNwCYKIc3mnsmG0eLp8bIrCIid5wi0HMCXAM6FGpPaF48nJC uxJvOx4AY+vz6OeBqeiNe6wAYulbXcuQw9nHTGTAM+WjwmvWefEdBJaJhP0Ky0plPM6l jEsJ/aJjXDPVGYoPDPmBiEWnE0SCrT4WZRdbN4fjH1T4wxzIBIdvRm7NSL1Rdbc6u0pO +kLGgsQneEuUCX3nVC0eq4LWEiRoA6GPY3IU3cmQiMjW0lm7gZFgirStmQ4nehC8SZdn 7TEg== X-Gm-Message-State: APzg51CESvcVWwbIEVbVfhuQD1FkIuFVFp/C2VEbwLp+r6Uxzu86/gbi fmakhGZgBhUlzRy1FCxlySKt1LI= X-Received: by 2002:aca:af11:: with SMTP id y17-v6mr29484832oie.274.1536176268642; Wed, 05 Sep 2018 12:37:48 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 12:37:48 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Salter , Aurelien Jacquiot , linux-c6x-dev@linux-c6x.org Subject: [PATCH 07/21] c6x: use for_each_of_cpu_node iterator Date: Wed, 5 Sep 2018 14:37:24 -0500 Message-Id: <20180905193738.19325-8-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: Mark Salter Cc: Aurelien Jacquiot Cc: linux-c6x-dev@linux-c6x.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/c6x/kernel/setup.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c index 786e36e2f61d..2e97455ca0b7 100644 --- a/arch/c6x/kernel/setup.c +++ b/arch/c6x/kernel/setup.c @@ -96,7 +96,7 @@ static void __init get_cpuinfo(void) unsigned long core_khz; u64 tmp; struct cpuinfo_c6x *p; - struct device_node *node, *np; + struct device_node *node; p = &per_cpu(cpu_data, smp_processor_id()); @@ -190,13 +190,8 @@ static void __init get_cpuinfo(void) p->core_id = get_coreid(); - node = of_find_node_by_name(NULL, "cpus"); - if (node) { - for_each_child_of_node(node, np) - if (!strcmp("cpu", np->name)) - ++c6x_num_cores; - of_node_put(node); - } + for_each_of_cpu_node(node) + ++c6x_num_cores; node = of_find_node_by_name(NULL, "soc"); if (node) {