aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/cpu/mcheck/therm_throt.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/i386/kernel/cpu/mcheck/therm_throt.c
index 4f43047de406..2d8703b7ce65 100644
--- a/arch/i386/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/i386/kernel/cpu/mcheck/therm_throt.c
@@ -110,17 +110,15 @@ int therm_throt_process(int curr)
110 110
111#ifdef CONFIG_SYSFS 111#ifdef CONFIG_SYSFS
112/* Add/Remove thermal_throttle interface for CPU device */ 112/* Add/Remove thermal_throttle interface for CPU device */
113static __cpuinit int thermal_throttle_add_dev(struct sys_device * sys_dev) 113static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev)
114{ 114{
115 sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group); 115 return sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group);
116 return 0;
117} 116}
118 117
119#ifdef CONFIG_HOTPLUG_CPU 118#ifdef CONFIG_HOTPLUG_CPU
120static __cpuinit int thermal_throttle_remove_dev(struct sys_device * sys_dev) 119static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev)
121{ 120{
122 sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group); 121 return sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group);
123 return 0;
124} 122}
125 123
126/* Mutex protecting device creation against CPU hotplug */ 124/* Mutex protecting device creation against CPU hotplug */
@@ -133,12 +131,14 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb,
133{ 131{
134 unsigned int cpu = (unsigned long)hcpu; 132 unsigned int cpu = (unsigned long)hcpu;
135 struct sys_device *sys_dev; 133 struct sys_device *sys_dev;
134 int err;
136 135
137 sys_dev = get_cpu_sysdev(cpu); 136 sys_dev = get_cpu_sysdev(cpu);
138 mutex_lock(&therm_cpu_lock); 137 mutex_lock(&therm_cpu_lock);
139 switch (action) { 138 switch (action) {
140 case CPU_ONLINE: 139 case CPU_ONLINE:
141 thermal_throttle_add_dev(sys_dev); 140 err = thermal_throttle_add_dev(sys_dev);
141 WARN_ON(err);
142 break; 142 break;
143 case CPU_DEAD: 143 case CPU_DEAD:
144 thermal_throttle_remove_dev(sys_dev); 144 thermal_throttle_remove_dev(sys_dev);
@@ -157,6 +157,7 @@ static struct notifier_block thermal_throttle_cpu_notifier =
157static __init int thermal_throttle_init_device(void) 157static __init int thermal_throttle_init_device(void)
158{ 158{
159 unsigned int cpu = 0; 159 unsigned int cpu = 0;
160 int err;
160 161
161 if (!atomic_read(&therm_throt_en)) 162 if (!atomic_read(&therm_throt_en))
162 return 0; 163 return 0;
@@ -167,8 +168,10 @@ static __init int thermal_throttle_init_device(void)
167 mutex_lock(&therm_cpu_lock); 168 mutex_lock(&therm_cpu_lock);
168#endif 169#endif
169 /* connect live CPUs to sysfs */ 170 /* connect live CPUs to sysfs */
170 for_each_online_cpu(cpu) 171 for_each_online_cpu(cpu) {
171 thermal_throttle_add_dev(get_cpu_sysdev(cpu)); 172 err = thermal_throttle_add_dev(get_cpu_sysdev(cpu));
173 WARN_ON(err);
174 }
172#ifdef CONFIG_HOTPLUG_CPU 175#ifdef CONFIG_HOTPLUG_CPU
173 mutex_unlock(&therm_cpu_lock); 176 mutex_unlock(&therm_cpu_lock);
174#endif 177#endif