/* Figure out to which domain a cpu belongs and stick it there. Return the id of the domain used.  */
static int __cpuinit numa_setup_cpu(unsigned long lcpu)
/* Figure out to which domain a cpu belongs and stick it there. Return the id of the domain used.  */
static int __cpuinit numa_setup_cpu(unsigned long lcpu)
{
	int nid = 0;
	struct device_node *cpu = of_get_cpu_node(lcpu, NULL);
	if (!cpu) {
		WARN_ON(1);
		goto out;
	}
	nid = of_node_to_nid_single(cpu);
	if (nid < 0 || !node_online(nid))
		nid = any_online_node(NODE_MASK_ALL);
out:
	map_cpu_to_node(lcpu, nid);
	of_node_put(cpu);
	return nid;
}