Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1610imm; Wed, 5 Sep 2018 12:41:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaqlX+ClWMXyTXHZ3lNFwlOut4sB0rwsX48fRKOn1V7gq0GnwPvlv4FoWl08K0/Gyxu4BD8 X-Received: by 2002:a63:6343:: with SMTP id x64-v6mr36958325pgb.173.1536176497536; Wed, 05 Sep 2018 12:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176497; cv=none; d=google.com; s=arc-20160816; b=Uxc67Qki8wjGNhxfGO0zb7DuT1+1gGVl+eUjH2A618NRhg6XVPBBTjTaVvNXroTZGr N60Zd03CBzhWQtTSWIyoXOMoOLC/SaUavZ96oqQwC6p1lJpNeYKREXG82KBERXvHqo3+ 5Osmvm6CcVO2Zi2gZzkJXP0ig/O6m3zyw2ddu7ZbOyCMOmRrfVPduZQETfcPek0kOeMP pW2kcDXFgzseKryOoCOneZVLSEo6gRa4oWnOgN4XHB9pfOy2epiB/Hg55smG4LYGD6hf gDfv+FacC0tiAZtkx4NUErJBlDmVN+j53cH2Ii4dzxkuERi2yNHbSOFQvm4OrDWG4bEP fd4A== 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 h9-v6si2790586pgk.121.2018.09.05.12.41.22; Wed, 05 Sep 2018 12:41:37 -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 S1728328AbeIFAKr (ORCPT + 99 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(-) 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) { -- 2.17.1