]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Don't find governor for setpolicy drivers in cpufreq_init_policy()
authorYue Hu <huyue2@yulong.com>
Mon, 29 Apr 2019 07:24:18 +0000 (15:24 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 13 May 2019 08:46:24 +0000 (10:46 +0200)
commit1060fb8acbbc39215df23bb65e77bbe21f4c4085
tree0109704579d0820dd21a3ea1bc49ce2bb100a74c
parentf722cbd5fe08c844bec5fdd714b5c9629144b674
cpufreq: Don't find governor for setpolicy drivers in cpufreq_init_policy()

In cpufreq_init_policy() we will check if there's last_governor for target
and setpolicy type. However last_governor is set only if has_target() is
true in cpufreq_offline(). That means find last_governor for setpolicy
type is pointless. Also new_policy.governor will not be used if ->setpolicy
callback is set in cpufreq_set_policy().

Moreover, there's duplicate ->setpolicy check in using default policy path.
Let's add a new helper function to avoid it. Also update comments.

Signed-off-by: Yue Hu <huyue2@yulong.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c