unsigned int cpu;
if (!cpu_has_feature(CPU_FTR_SMT))
- return -ENODEV;
+ return 1;
options = find_path_device("/options");
if (!options)
- return -ENODEV;
+ return 1;
val = (unsigned int *)get_property(options, "ibm,smt-snooze-delay",
NULL);
if (!smt_snooze_cmdline && val) {
- for_each_possible_cpu(cpu)
+ for_each_cpu(cpu)
per_cpu(smt_snooze_delay, cpu) = *val;
}
- return 0;
+ return 1;
}
__initcall(smt_setup);
smt_snooze_cmdline = 1;
if (get_option(&str, &snooze)) {
- for_each_possible_cpu(cpu)
+ for_each_cpu(cpu)
per_cpu(smt_snooze_delay, cpu) = snooze;
}
}
#endif /* CONFIG_HOTPLUG_CPU */
-static int sysfs_cpu_notify(struct notifier_block *self,
+static int __devinit sysfs_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned int)(long)hcpu;
return NOTIFY_OK;
}
-static struct notifier_block sysfs_cpu_nb = {
+static struct notifier_block __devinitdata sysfs_cpu_nb = {
.notifier_call = sysfs_cpu_notify,
};
}
}
}
-
-int sysfs_add_device_to_node(struct sys_device *dev, int nid)
-{
- struct node *node = &node_devices[nid];
- return sysfs_create_link(&node->sysdev.kobj, &dev->kobj,
- kobject_name(&dev->kobj));
-}
-
-void sysfs_remove_device_from_node(struct sys_device *dev, int nid)
-{
- struct node *node = &node_devices[nid];
- sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj));
-}
-
#else
static void register_nodes(void)
{
return;
}
-
#endif
-EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
-EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);
-
/* Only valid if CPU is present. */
static ssize_t show_physical_id(struct sys_device *dev, char *buf)
{
register_cpu_notifier(&sysfs_cpu_nb);
- for_each_possible_cpu(cpu) {
+ for_each_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);
#ifdef CONFIG_NUMA