Merge tag 'devicetree-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-starfive.git] / arch / x86 / kernel / devicetree.c
index 78b2311..5cd51f2 100644 (file)
@@ -134,12 +134,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;
                }