From patchwork Wed Oct 6 16:43:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 515366 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp590435ime; Wed, 6 Oct 2021 09:44:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz4uCxgsSY36QyLbz/AXH7LrILfZFAHrfDoostM39ypyjn5bqO/E5S7xFjtEnEf/XevOgM X-Received: by 2002:a17:906:2f15:: with SMTP id v21mr32982338eji.444.1633538644289; Wed, 06 Oct 2021 09:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633538644; cv=none; d=google.com; s=arc-20160816; b=WutCY1iNN/V/RKCJrxfu9IHs3zDcOzi9oYU7BIrrxROMjo1K/38e29LhiQVKQugwm/ woyG/dEULEw7tq4HK23qRx10MBSOODKZiJgDWqoq6/IrNGTCNsac7sUcaG23Am7asfC9 zBIL2kGxBFDCeLsV+t7esfo010dCD3HluZRo7b4FB3p4+89DBHh7GTlPr9iHPOQADV2E EgbwhoylSJsNTS9O7gb3ygyEO2nGMGPjGRCLDNfG5WMQCAstehnf5xXWJpFiCRpAAhjp 0Ugdhh+rhZHAcFQlVDd14Cm6ApERuqSKxRYcBTwRvrhIuh9uG7hn3Qu2OL2qmIsZmaTK NS+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qVDBxu87TJi7lJ0TsvF77hW6cToukGJnTBFK4bAPEHE=; b=mKn8nJO0QnKyM7rY8NRdnKcAwoYbWsGrgpqirQDEK5L5KDacvFnT+dQ31TkjB9L0QT 85hlnjGJxy0fHZXVmHezmfvCISgkSkv/fxv9OYui1aVCikKO3FXqv7+A3hXnEoBPyVFo 0n8CYk3AoLXur8VeMtL2lSOja0HzLFSTbmk/beQlCpn+YAftFQsaxESpyM6Tjzd54Cgv ZZBYSZWUWFVgBMQ1dpQA2r55nsS0jq+dr1qdbyBkbUj73dwl/Hf5qlvjIX7RqlVdQIL+ 7dfphLGJggWsPPpMOpgHVJgva24CdE0qDEPeH0S4qRbhuGjdEfr82Mg7QB5n8JegOsN9 msQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si28163076edj.97.2021.10.06.09.44.04; Wed, 06 Oct 2021 09:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239485AbhJFQpz (ORCPT + 7 others); Wed, 6 Oct 2021 12:45:55 -0400 Received: from mail-oo1-f41.google.com ([209.85.161.41]:36628 "EHLO mail-oo1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239476AbhJFQpp (ORCPT ); Wed, 6 Oct 2021 12:45:45 -0400 Received: by mail-oo1-f41.google.com with SMTP id e19-20020a4a7353000000b002b5a2c0d2b8so1029974oof.3; Wed, 06 Oct 2021 09:43:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qVDBxu87TJi7lJ0TsvF77hW6cToukGJnTBFK4bAPEHE=; b=yK4hHPrJnssJl72XgmZ9NbKgB+3h/U3+gTnqb0YNqjkHpu1j8D3hNTaK3yGbgAJq8d bAmEzwSzcMtAQDMnteCAkdbK4pXAlpPfJzrgN0w4H5vvfi5knIM/2ORXE556NGhk+kvU kYkfnZruyykjXwB9YVTz7uE3R+xiWHw5OfzFl5KLUIirNyEYvqK3xRP60q5BCXRd4lgI NqDqIZSKlnLNfVWIEfJczsXfZUumIIKmuBvHacdbVQFDXxQktOvzN0kqtTV8EWDpZNQb 1fdtPzUzz8neXqmq5jnye2bjusqMFuRDl9Dv/qTDxsophjznuq1x9ALq7MNCF2PWSme3 7txw== X-Gm-Message-State: AOAM5339ZnVjNt1rY9IHmf/ZW1KkVkqyvc2ipKgoieQzp0otrOZxPp55 RFubDWIanJ/fTxsa+j1Hbw== X-Received: by 2002:a4a:e597:: with SMTP id o23mr6391984oov.96.1633538632948; Wed, 06 Oct 2021 09:43:52 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id s29sm4236628otg.60.2021.10.06.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 09:43:52 -0700 (PDT) From: Rob Herring To: Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 09/12] sh: Use of_get_cpu_hwid() Date: Wed, 6 Oct 2021 11:43:29 -0500 Message-Id: <20211006164332.1981454-10-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211006164332.1981454-1-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Rob Herring --- arch/sh/boards/of-generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index 921d76fc3358..f7f3e618e85b 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -62,9 +62,8 @@ static void sh_of_smp_probe(void) init_cpu_possible(cpumask_of(0)); for_each_of_cpu_node(np) { - const __be32 *cell = of_get_property(np, "reg", NULL); - u64 id = -1; - if (cell) id = of_read_number(cell, of_n_addr_cells(np)); + u64 id = of_get_cpu_hwid(np, 0); + if (id < NR_CPUS) { if (!method) of_property_read_string(np, "enable-method", &method);