aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2014-12-14 09:06:38 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-12-19 17:01:12 -0500
commita59e5109f648f703d877d3c33cc5a7ef283dba83 (patch)
tree262c61561056dabd1d188a63d41bbc28ac2bd462 /tools/power/cpupower
parentad1d8313cdeec8bc10cecb2143d047eb565b9f65 (diff)
tools / cpupower: Fix no idle state information return value
sysfs_get_idlestate_count() returns an unsigned int. Returning -ENODEV is not the right thing to do here, and in any case is handled the same way as if there are no states found. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/cpupower')
-rw-r--r--tools/power/cpupower/utils/helpers/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c
index 09afe5d87f2b..4e8fe2c7b054 100644
--- a/tools/power/cpupower/utils/helpers/sysfs.c
+++ b/tools/power/cpupower/utils/helpers/sysfs.c
@@ -361,7 +361,7 @@ unsigned int sysfs_get_idlestate_count(unsigned int cpu)
361 361
362 snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle"); 362 snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle");
363 if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) 363 if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
364 return -ENODEV; 364 return 0;
365 365
366 snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu); 366 snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu);
367 if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) 367 if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))