From patchwork Wed Oct 6 16:43:30 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: 515367 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp590463ime; Wed, 6 Oct 2021 09:44:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweT+zzImySuC9rUIxWoFgjum3Ms5wassGBxnhfT98vXF8cd+Qgh7ARakLWxMg5tE1BSnWc X-Received: by 2002:a17:906:12c6:: with SMTP id l6mr32725390ejb.373.1633538647201; Wed, 06 Oct 2021 09:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633538647; cv=none; d=google.com; s=arc-20160816; b=ibBvM+KaWMKNmtzaNQ++J4ORruUDIQo6onySoZ5vKbb0z4uxTGLaV2uIJlIdNz2HTR qBmJDLHAI2c5pXwcrmD2LeVMMXi27yIrq4/hbw+y+BElXay6FPoUoNoMdQTJ8poCZ6AH bXp86/IxPcQysaETyVJwTZflEG3RmWJrFAvk6GlIZFiHcBKuh96Ef81iCfYSQz1BPhKg 3+Be76HzPLspVUD3Uj8dktwxCzT60DRanqk57DsddsFkfPtRLBMDua5PFYYAHIeOCfwN wPGxJMiU17zetOn6n+VHyN7EKA3dChho8kkvhkX8Kh42uaeWyPAJ/LW51ZN92Ne2+ujm dh5w== 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=J13zoIHrX4tLH3WneJUTeWV7jFKNgk6/LfnJOFSAv7E=; b=ilEtXm8DEhfRvtqfFbFqspJ4Dfuq5xG+LjwLk4v6piEXv2QWIUEJ2WROtCGnyY9K2/ B0YWB+g0tA6TCM4VU/h/ukIP0J0F8ox0Y95620y9TqYCUw8mNcyyNxORifE9Nnj/Wl2g PrHMFYjah8m5wIouE61Za84gRjqFnaeeT28sQcMVmc5mgf9lG0moWvQg76tpnEtX3NR2 DPhszNs70BKmhZRGgO2BFOtNSmueXAUECS0wCL0TSpiO7Q/hlMruEj+8hJJUD2HEPvlj tj+5rUJnxIvx0xMYZl4KGafrKn5u2STaG6N8+BoPyUEZ6hzP7IlJq1x/UjL+qJxlaOJR Fywg== 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.06; Wed, 06 Oct 2021 09:44:07 -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 S239538AbhJFQp5 (ORCPT + 7 others); Wed, 6 Oct 2021 12:45:57 -0400 Received: from mail-oi1-f178.google.com ([209.85.167.178]:45968 "EHLO mail-oi1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239496AbhJFQpr (ORCPT ); Wed, 6 Oct 2021 12:45:47 -0400 Received: by mail-oi1-f178.google.com with SMTP id v10so4795392oic.12; Wed, 06 Oct 2021 09:43:55 -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=J13zoIHrX4tLH3WneJUTeWV7jFKNgk6/LfnJOFSAv7E=; b=D2q5si30HENPddgh9NAhi3id+d7hMzBibYaQjh8aFhAXmC5sZp1/uZXxxVFK2U8bsn zVlUIobvs/vlwbDEJ7KS6FVppDsLt97lCDGB7DBkx3Iu5xsr+SJLnxwcnQD51GMFdBgK TtB1Wybv6C99jAXp9Y1+D9BvzQv8edrYlJhI1ACAW8w1/Y4Ou8gnY63xdyHKm7sOcQqm uFUDcetrGuffv2EipBxUEyS8TS2MvjUX/Ae4Asmjlnes2ArM7hAlQjp8qntUK1zKe8U4 0Pc9JpZKqoBSvoCs9guqtHqzPLJBq75BnrYJe6t/NH8rtKF9NhMWUUAQjYt/5NaVEdb+ h/fQ== X-Gm-Message-State: AOAM531ImG11BE73+oeNwxbv9089HTclcJBdPuP4LJbEpt+YUFaS0QyN LA9F3X9Cfu0Z2mhKWqrYkA== X-Received: by 2002:aca:c288:: with SMTP id s130mr7509039oif.138.1633538634953; Wed, 06 Oct 2021 09:43:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 09:43:54 -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 10/12] x86: dt: Use of_get_cpu_hwid() Date: Wed, 6 Oct 2021 11:43:30 -0500 Message-Id: <20211006164332.1981454-11-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: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Rob Herring --- arch/x86/kernel/devicetree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 6a4cb71c2498..3aa1e99df2a9 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -139,12 +139,11 @@ static void __init dtb_cpu_setup(void) { struct device_node *dn; u32 apic_id, version; - int ret; version = GET_APIC_VERSION(apic_read(APIC_LVR)); for_each_of_cpu_node(dn) { - ret = of_property_read_u32(dn, "reg", &apic_id); - if (ret < 0) { + apic_id = of_get_cpu_hwid(dn, 0); + if (apic_id == ~0U) { pr_warn("%pOF: missing local APIC ID\n", dn); continue; }