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)
commitab05d97a3785088fa2964219227a1ba95d97d590
tree0109704579d0820dd21a3ea1bc49ce2bb100a74c
parent2acb9bdae92d0662cd4fa11c481e80b6202b5630
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