diff options
Diffstat (limited to 'drivers/base/cpu.c')
| -rw-r--r-- | drivers/base/cpu.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index e62a4ccea54d..7c03af7b84a9 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
| @@ -72,6 +72,38 @@ void unregister_cpu(struct cpu *cpu) | |||
| 72 | per_cpu(cpu_sys_devices, logical_cpu) = NULL; | 72 | per_cpu(cpu_sys_devices, logical_cpu) = NULL; |
| 73 | return; | 73 | return; |
| 74 | } | 74 | } |
| 75 | |||
| 76 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | ||
| 77 | static ssize_t cpu_probe_store(struct class *class, const char *buf, | ||
| 78 | size_t count) | ||
| 79 | { | ||
| 80 | return arch_cpu_probe(buf, count); | ||
| 81 | } | ||
| 82 | |||
| 83 | static ssize_t cpu_release_store(struct class *class, const char *buf, | ||
| 84 | size_t count) | ||
| 85 | { | ||
| 86 | return arch_cpu_release(buf, count); | ||
| 87 | } | ||
| 88 | |||
| 89 | static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); | ||
| 90 | static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store); | ||
| 91 | |||
| 92 | int __init cpu_probe_release_init(void) | ||
| 93 | { | ||
| 94 | int rc; | ||
| 95 | |||
| 96 | rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | ||
| 97 | &class_attr_probe.attr); | ||
| 98 | if (!rc) | ||
| 99 | rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | ||
| 100 | &class_attr_release.attr); | ||
| 101 | |||
| 102 | return rc; | ||
| 103 | } | ||
| 104 | device_initcall(cpu_probe_release_init); | ||
| 105 | #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ | ||
| 106 | |||
| 75 | #else /* ... !CONFIG_HOTPLUG_CPU */ | 107 | #else /* ... !CONFIG_HOTPLUG_CPU */ |
| 76 | static inline void register_cpu_control(struct cpu *cpu) | 108 | static inline void register_cpu_control(struct cpu *cpu) |
| 77 | { | 109 | { |
