From 5e3cc8fcb5aaa0f43553263d820328c6e5f0345d Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 4 Feb 2016 15:32:18 +0000 Subject: [PATCH] cpufreq: minor fixes - added a missing conversion from int to cpu name. - fixed the invocation of the current cpu frequency function inside core and cluster versions. --- wlauto/modules/cpufreq.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wlauto/modules/cpufreq.py b/wlauto/modules/cpufreq.py index 17afd3cf..d869b31a 100644 --- a/wlauto/modules/cpufreq.py +++ b/wlauto/modules/cpufreq.py @@ -237,6 +237,8 @@ class CpufreqModule(Module): :raises: DeviceError if for some reason the frequency could not be read. """ + if isinstance(cpu, int): + cpu = 'cpu{}'.format(cpu) sysfile = '/sys/devices/system/cpu/{}/cpufreq/scaling_cur_freq'.format(cpu) return self.device.get_sysfile_value(sysfile) @@ -393,7 +395,7 @@ class CpufreqModule(Module): def get_cluster_cur_frequency(self, cluster): cpu = self.get_cluster_active_cpu(cluster) - return self.get_cpu_cur_frequency(cpu) + return self.get_cpu_frequency(cpu) def set_cluster_cur_frequency(self, cluster, freq): cpu = self.get_cluster_active_cpu(cluster) @@ -434,7 +436,7 @@ class CpufreqModule(Module): self.set_cluster_min_frequency(cluster, freq) def get_core_cur_frequency(self, core): - return self.get_cpu_cur_frequency(self.get_core_online_cpu(core)) + return self.get_cpu_frequency(self.get_core_online_cpu(core)) def set_core_cur_frequency(self, core, freq): for cluster in self.get_core_clusters(core):