Merge tag 'cpufreq-arm-updates-6.4' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-rpi.git] / drivers / cpufreq / freq_table.c
index 90bfc27..c4d4643 100644 (file)
@@ -355,8 +355,13 @@ int cpufreq_table_validate_and_sort(struct cpufreq_policy *policy)
 {
        int ret;
 
-       if (!policy->freq_table)
+       if (!policy->freq_table) {
+               /* Freq table must be passed by drivers with target_index() */
+               if (has_target_index())
+                       return -EINVAL;
+
                return 0;
+       }
 
        ret = cpufreq_frequency_table_cpuinfo(policy, policy->freq_table);
        if (ret)