From: Rob Herring Date: Wed, 6 Oct 2021 16:43:30 +0000 (-0500) Subject: x86: dt: Use of_get_cpu_hwid() X-Git-Tag: howlett/maple/20220722_2~1936^2~23 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7688fa1025cda1463b091bf2212f2afa68ceb711;p=users%2Fjedix%2Flinux-maple.git x86: dt: Use of_get_cpu_hwid() 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 Link: https://lore.kernel.org/r/20211006164332.1981454-11-robh@kernel.org --- 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; }