|
@@ -779,6 +779,25 @@ exit:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+int thermal_build_list_of_policies(char *buf)
|
|
|
+{
|
|
|
+ struct thermal_governor *pos;
|
|
|
+ ssize_t count = 0;
|
|
|
+ ssize_t size = PAGE_SIZE;
|
|
|
+
|
|
|
+ mutex_lock(&thermal_governor_lock);
|
|
|
+
|
|
|
+ list_for_each_entry(pos, &thermal_governor_list, governor_list) {
|
|
|
+ size = PAGE_SIZE - count;
|
|
|
+ count += scnprintf(buf + count, size, "%s ", pos->name);
|
|
|
+ }
|
|
|
+ count += scnprintf(buf + count, size, "\n");
|
|
|
+
|
|
|
+ mutex_unlock(&thermal_governor_lock);
|
|
|
+
|
|
|
+ return count;
|
|
|
+}
|
|
|
+
|
|
|
/* sys I/F for thermal zone */
|
|
|
|
|
|
#define to_thermal_zone(_dev) \
|
|
@@ -1048,21 +1067,7 @@ static ssize_t
|
|
|
available_policies_show(struct device *dev, struct device_attribute *devattr,
|
|
|
char *buf)
|
|
|
{
|
|
|
- struct thermal_governor *pos;
|
|
|
- ssize_t count = 0;
|
|
|
- ssize_t size = PAGE_SIZE;
|
|
|
-
|
|
|
- mutex_lock(&thermal_governor_lock);
|
|
|
-
|
|
|
- list_for_each_entry(pos, &thermal_governor_list, governor_list) {
|
|
|
- size = PAGE_SIZE - count;
|
|
|
- count += scnprintf(buf + count, size, "%s ", pos->name);
|
|
|
- }
|
|
|
- count += scnprintf(buf + count, size, "\n");
|
|
|
-
|
|
|
- mutex_unlock(&thermal_governor_lock);
|
|
|
-
|
|
|
- return count;
|
|
|
+ return thermal_build_list_of_policies(buf);
|
|
|
}
|
|
|
|
|
|
static ssize_t
|