From patchwork Wed Sep 5 19:37:27 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: 146026 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp5340217ljw; Wed, 5 Sep 2018 12:37:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaOybSx4hUOAjud5bkijTtV/d5FUKWbhkMG5Y815aNJh9yQ8/GnCElE3WUyJ9P/Z+LeKXfb X-Received: by 2002:a17:902:42e2:: with SMTP id h89-v6mr39669479pld.69.1536176273926; Wed, 05 Sep 2018 12:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176273; cv=none; d=google.com; s=arc-20160816; b=AYip5Uu8Xtm9wFhHnFwAYr3JBYoRH+gqBh0CH0so8F+JZT/XTzOzDgOyIcwUqVykPn Cr4R2rnDTQ2tdEE8bkkx7a3lex01w+C4ZjnwfsO6hnCIu8l0AOzkJruJcuQ7tgmJREtv LyJGqf7oqV2Qg6mXHRQOiM/nOy7T761uloRXqGGVznGp9qghE39ufhnTr8x4kv2KI4gB 3/8TS6blj0qQsQL+FvYd+FmBMZsQXlyeVcKVQeTjG/AX3UYIggTSbMFqVNaSQHOdDwoB NfPz9vLKxAzWvQBlSc4k6fCaSHfAuwvG+89MD0GxdY0ezcdUwvHoOmCtvrY+51ZUvdW3 taxA== 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=s7aN5Q50ZwUddwkIjc7Sz8kupEdtSiBHeR4i+os989Q=; b=r3Jiv1dmHoFUh2xS+mDRWLEa/jXcvNvWmrdJhOwJLIpAWT/nMDBnZ0KmlwK1Fh2R2Y gybaeaI+bAfmcQL299fJn+aMpjeS0EoFbdjqkwC4Ba5BA4h5fW3yktPgyLFJCA1EztNq M69+yxYC+7712HGy5cJz2hg03uL0kMlJishCLvfBGJv2Ojnp85ybdB4V/gb8VzkztjaV rFaPWsghVl+vuXCr5+7cFV5tHg6bmyIodmNrkyz/kzYE/1lauGtteGkTVyzafJlx1YdT CBymXumI09tj0a9ZA7L+fx3L5GH9l/s9e3OqzWMdYMdxpOhkcf4pDcfoNt6J7qO+tdAb mVnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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.53; Wed, 05 Sep 2018 12:37:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1728077AbeIFAJ3 (ORCPT + 6 others); Wed, 5 Sep 2018 20:09:29 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36321 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728094AbeIFAJ3 (ORCPT ); Wed, 5 Sep 2018 20:09:29 -0400 Received: by mail-oi0-f66.google.com with SMTP id r69-v6so15955536oie.3; Wed, 05 Sep 2018 12:37:51 -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=s7aN5Q50ZwUddwkIjc7Sz8kupEdtSiBHeR4i+os989Q=; b=nGNNmmCmBG3HsKWQY5ds3F3aV+d4oxaIbo1VxieBsk1DaD36x+3JDVKBn7qaLXx4da +oFwIYueklgMAI2EL32scFTTFY/o1KxaypZC5lpWW+QRjLR6js6z2bjlXJcv9An47isl MUVi/t40R/K4RoZWJGMqk68+yH34DTIvEPREX4nfcYakv3dQS7tnl8OysYoG7AXUrpCk f/We3BPoSImSmqWKjYuKyQ4M5ZMlJniTsrikkrA3F9gf+XMVD66CZ+8Y9rwPagaC6t3d 6COGuTxSO5LiqHH1naTHrsj4o3ab+jlxQX4gnww0aMj46rO7Kn8DHRf04uIfkgHvT1ac OOkw== X-Gm-Message-State: APzg51AB6H9RiZXuciI8K86oXk9Ljr6o5KgObDeCR/knwTuOOY5sy2Eo DZXhFmLIjFf82OSOUA87S+Cf2EI= X-Received: by 2002:aca:aa06:: with SMTP id t6-v6mr33049047oie.152.1536176271371; Wed, 05 Sep 2018 12:37:51 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 12:37:50 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonas Bonn , Stefan Kristiansson , Stafford Horne , openrisc@lists.librecores.org Subject: [PATCH 10/21] openrisc: use for_each_of_cpu_node iterator Date: Wed, 5 Sep 2018 14:37:27 -0500 Message-Id: <20180905193738.19325-11-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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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". This also fixes a leaked reference for cpus node. Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: openrisc@lists.librecores.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/openrisc/kernel/setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 9d28ab14d139..e17fcd83120f 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -158,9 +158,8 @@ static struct device_node *setup_find_cpu_node(int cpu) { u32 hwid; struct device_node *cpun; - struct device_node *cpus = of_find_node_by_path("/cpus"); - for_each_available_child_of_node(cpus, cpun) { + for_each_of_cpu_node(cpun) { if (of_property_read_u32(cpun, "reg", &hwid)) continue; if (hwid == cpu)