diff options
Diffstat (limited to 'arch/ia64/kernel/topology.c')
-rw-r--r-- | arch/ia64/kernel/topology.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index 879edb51d1e0..5511d9c6c701 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
@@ -26,19 +26,10 @@ | |||
26 | #include <asm/numa.h> | 26 | #include <asm/numa.h> |
27 | #include <asm/cpu.h> | 27 | #include <asm/cpu.h> |
28 | 28 | ||
29 | #ifdef CONFIG_NUMA | ||
30 | static struct node *sysfs_nodes; | ||
31 | #endif | ||
32 | static struct ia64_cpu *sysfs_cpus; | 29 | static struct ia64_cpu *sysfs_cpus; |
33 | 30 | ||
34 | int arch_register_cpu(int num) | 31 | int arch_register_cpu(int num) |
35 | { | 32 | { |
36 | struct node *parent = NULL; | ||
37 | |||
38 | #ifdef CONFIG_NUMA | ||
39 | parent = &sysfs_nodes[cpu_to_node(num)]; | ||
40 | #endif /* CONFIG_NUMA */ | ||
41 | |||
42 | #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) | 33 | #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) |
43 | /* | 34 | /* |
44 | * If CPEI cannot be re-targetted, and this is | 35 | * If CPEI cannot be re-targetted, and this is |
@@ -48,21 +39,14 @@ int arch_register_cpu(int num) | |||
48 | sysfs_cpus[num].cpu.no_control = 1; | 39 | sysfs_cpus[num].cpu.no_control = 1; |
49 | #endif | 40 | #endif |
50 | 41 | ||
51 | return register_cpu(&sysfs_cpus[num].cpu, num, parent); | 42 | return register_cpu(&sysfs_cpus[num].cpu, num); |
52 | } | 43 | } |
53 | 44 | ||
54 | #ifdef CONFIG_HOTPLUG_CPU | 45 | #ifdef CONFIG_HOTPLUG_CPU |
55 | 46 | ||
56 | void arch_unregister_cpu(int num) | 47 | void arch_unregister_cpu(int num) |
57 | { | 48 | { |
58 | struct node *parent = NULL; | 49 | return unregister_cpu(&sysfs_cpus[num].cpu); |
59 | |||
60 | #ifdef CONFIG_NUMA | ||
61 | int node = cpu_to_node(num); | ||
62 | parent = &sysfs_nodes[node]; | ||
63 | #endif /* CONFIG_NUMA */ | ||
64 | |||
65 | return unregister_cpu(&sysfs_cpus[num].cpu, parent); | ||
66 | } | 50 | } |
67 | EXPORT_SYMBOL(arch_register_cpu); | 51 | EXPORT_SYMBOL(arch_register_cpu); |
68 | EXPORT_SYMBOL(arch_unregister_cpu); | 52 | EXPORT_SYMBOL(arch_unregister_cpu); |
@@ -74,17 +58,11 @@ static int __init topology_init(void) | |||
74 | int i, err = 0; | 58 | int i, err = 0; |
75 | 59 | ||
76 | #ifdef CONFIG_NUMA | 60 | #ifdef CONFIG_NUMA |
77 | sysfs_nodes = kzalloc(sizeof(struct node) * MAX_NUMNODES, GFP_KERNEL); | ||
78 | if (!sysfs_nodes) { | ||
79 | err = -ENOMEM; | ||
80 | goto out; | ||
81 | } | ||
82 | |||
83 | /* | 61 | /* |
84 | * MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes? | 62 | * MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes? |
85 | */ | 63 | */ |
86 | for_each_online_node(i) { | 64 | for_each_online_node(i) { |
87 | if ((err = register_node(&sysfs_nodes[i], i, 0))) | 65 | if ((err = register_one_node(i))) |
88 | goto out; | 66 | goto out; |
89 | } | 67 | } |
90 | #endif | 68 | #endif |
@@ -426,7 +404,7 @@ static int __cpuinit cache_remove_dev(struct sys_device * sys_dev) | |||
426 | * When a cpu is hot-plugged, do a check and initiate | 404 | * When a cpu is hot-plugged, do a check and initiate |
427 | * cache kobject if necessary | 405 | * cache kobject if necessary |
428 | */ | 406 | */ |
429 | static int cache_cpu_callback(struct notifier_block *nfb, | 407 | static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, |
430 | unsigned long action, void *hcpu) | 408 | unsigned long action, void *hcpu) |
431 | { | 409 | { |
432 | unsigned int cpu = (unsigned long)hcpu; | 410 | unsigned int cpu = (unsigned long)hcpu; |
@@ -444,7 +422,7 @@ static int cache_cpu_callback(struct notifier_block *nfb, | |||
444 | return NOTIFY_OK; | 422 | return NOTIFY_OK; |
445 | } | 423 | } |
446 | 424 | ||
447 | static struct notifier_block cache_cpu_notifier = | 425 | static struct notifier_block __cpuinitdata cache_cpu_notifier = |
448 | { | 426 | { |
449 | .notifier_call = cache_cpu_callback | 427 | .notifier_call = cache_cpu_callback |
450 | }; | 428 | }; |