kasan_init_hw_tags();
 }
 
-static u64 __init of_get_cpu_mpidr(struct device_node *dn)
-{
-       const __be32 *cell;
-       u64 hwid;
-
-       /*
-        * A cpu node with missing "reg" property is
-        * considered invalid to build a cpu_logical_map
-        * entry.
-        */
-       cell = of_get_property(dn, "reg", NULL);
-       if (!cell) {
-               pr_err("%pOF: missing reg property\n", dn);
-               return INVALID_HWID;
-       }
-
-       hwid = of_read_number(cell, of_n_addr_cells(dn));
-       /*
-        * Non affinity bits must be set to 0 in the DT
-        */
-       if (hwid & ~MPIDR_HWID_BITMASK) {
-               pr_err("%pOF: invalid reg property\n", dn);
-               return INVALID_HWID;
-       }
-       return hwid;
-}
-
 /*
  * Duplicate MPIDRs are a recipe for disaster. Scan all initialized
  * entries and check for duplicates. If any is found just ignore the
        struct device_node *dn;
 
        for_each_of_cpu_node(dn) {
-               u64 hwid = of_get_cpu_mpidr(dn);
+               u64 hwid = of_get_cpu_hwid(dn, 0);
 
-               if (hwid == INVALID_HWID)
+               if (hwid & ~MPIDR_HWID_BITMASK)
                        goto next;
 
                if (is_mpidr_duplicate(cpu_count, hwid)) {