cpufreq: drivers with target_index() must set freq_table
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 3 Apr 2023 23:39:10 +0000 (05:09 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 7 Apr 2023 11:21:58 +0000 (13:21 +0200)
commita038895e25b296ca1ef0254f92673ea64bc1a2ee
tree83a7ab4c47553a9d958298ad6550ec947a5abf7d
parent175c9df15aef7a1446fb67154a186b73dd892b50
cpufreq: drivers with target_index() must set freq_table

Since the cpufreq core directly uses freq_table, for cpufreq drivers
that set their target_index() callback, make it mandatory for them to
set the same.

Since this is set per policy and normally from policy->init(), do this
from cpufreq_table_validate_and_sort() which gets called right after
->init().

Reported-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c
drivers/cpufreq/freq_table.c
include/linux/cpufreq.h