|
@@ -110,17 +110,15 @@ int therm_throt_process(int curr)
|
|
|
|
|
|
#ifdef CONFIG_SYSFS
|
|
#ifdef CONFIG_SYSFS
|
|
/* Add/Remove thermal_throttle interface for CPU device */
|
|
/* Add/Remove thermal_throttle interface for CPU device */
|
|
-static __cpuinit int thermal_throttle_add_dev(struct sys_device * sys_dev)
|
|
|
|
|
|
+static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev)
|
|
{
|
|
{
|
|
- sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group);
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
-static __cpuinit int thermal_throttle_remove_dev(struct sys_device * sys_dev)
|
|
|
|
|
|
+static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev)
|
|
{
|
|
{
|
|
- sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group);
|
|
}
|
|
}
|
|
|
|
|
|
/* Mutex protecting device creation against CPU hotplug */
|
|
/* Mutex protecting device creation against CPU hotplug */
|
|
@@ -133,12 +131,14 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb,
|
|
{
|
|
{
|
|
unsigned int cpu = (unsigned long)hcpu;
|
|
unsigned int cpu = (unsigned long)hcpu;
|
|
struct sys_device *sys_dev;
|
|
struct sys_device *sys_dev;
|
|
|
|
+ int err;
|
|
|
|
|
|
sys_dev = get_cpu_sysdev(cpu);
|
|
sys_dev = get_cpu_sysdev(cpu);
|
|
mutex_lock(&therm_cpu_lock);
|
|
mutex_lock(&therm_cpu_lock);
|
|
switch (action) {
|
|
switch (action) {
|
|
case CPU_ONLINE:
|
|
case CPU_ONLINE:
|
|
- thermal_throttle_add_dev(sys_dev);
|
|
|
|
|
|
+ err = thermal_throttle_add_dev(sys_dev);
|
|
|
|
+ WARN_ON(err);
|
|
break;
|
|
break;
|
|
case CPU_DEAD:
|
|
case CPU_DEAD:
|
|
thermal_throttle_remove_dev(sys_dev);
|
|
thermal_throttle_remove_dev(sys_dev);
|
|
@@ -157,6 +157,7 @@ static struct notifier_block thermal_throttle_cpu_notifier =
|
|
static __init int thermal_throttle_init_device(void)
|
|
static __init int thermal_throttle_init_device(void)
|
|
{
|
|
{
|
|
unsigned int cpu = 0;
|
|
unsigned int cpu = 0;
|
|
|
|
+ int err;
|
|
|
|
|
|
if (!atomic_read(&therm_throt_en))
|
|
if (!atomic_read(&therm_throt_en))
|
|
return 0;
|
|
return 0;
|
|
@@ -167,8 +168,10 @@ static __init int thermal_throttle_init_device(void)
|
|
mutex_lock(&therm_cpu_lock);
|
|
mutex_lock(&therm_cpu_lock);
|
|
#endif
|
|
#endif
|
|
/* connect live CPUs to sysfs */
|
|
/* connect live CPUs to sysfs */
|
|
- for_each_online_cpu(cpu)
|
|
|
|
- thermal_throttle_add_dev(get_cpu_sysdev(cpu));
|
|
|
|
|
|
+ for_each_online_cpu(cpu) {
|
|
|
|
+ err = thermal_throttle_add_dev(get_cpu_sysdev(cpu));
|
|
|
|
+ WARN_ON(err);
|
|
|
|
+ }
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
mutex_unlock(&therm_cpu_lock);
|
|
mutex_unlock(&therm_cpu_lock);
|
|
#endif
|
|
#endif
|