static int __init topology_init(void) { int cpu; register_nodes(); register_cpu_notifier(&sysfs_cpu_nb); for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); /* * For now, we just see if the system supports making * the RTAS calls for CPU hotplug. But, there may be a * more comprehensive way to do this for an individual * CPU. For instance, the boot cpu might never be valid * for hotplugging. */ if (ppc_md.cpu_die) c->hotpluggable = 1; if (cpu_online(cpu) || c->hotpluggable) { register_cpu(c, cpu); device_create_file(&c->dev, &dev_attr_physical_id); } if (cpu_online(cpu)) register_cpu_online(cpu); } #ifdef CONFIG_PPC64 sysfs_create_dscr_default(); #endif /* CONFIG_PPC64 */ return 0; }
static int __init topology_init(void) { int cpu; register_nodes(); register_cpu_notifier(&sysfs_cpu_nb); for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); if (ppc_md.cpu_die) c->hotpluggable = 1; if (cpu_online(cpu) || c->hotpluggable) { register_cpu(c, cpu); device_create_file(&c->dev, &dev_attr_physical_id); } if (cpu_online(cpu)) register_cpu_online(cpu); } #ifdef CONFIG_PPC64 sysfs_create_dscr_default(); #endif return 0; }