summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2014-05-07 19:33:33 +0300
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>2015-02-04 11:14:31 +0100
commit323d80dff930ab6555e38f9984581685cb00f084 (patch)
tree84255db9cb5f4c38c3e783f8e262593092c7cbce
parent99ebcfdd67ac6fc18a06d4eac6198d89f70d7229 (diff)
downloadlinux-stable-323d80dff930ab6555e38f9984581685cb00f084.tar.gz
linux-stable-323d80dff930ab6555e38f9984581685cb00f084.tar.bz2
linux-stable-323d80dff930ab6555e38f9984581685cb00f084.zip
cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
On platforms that use cpufreq_for_each_* macros, build fails if CONFIG_CPU_FREQ=n, e.g. ARM/shmobile/koelsch/non-multiplatform: drivers/built-in.o: In function `clk_round_parent': clkdev.c:(.text+0xcf168): undefined reference to `cpufreq_next_valid' drivers/built-in.o: In function `clk_rate_table_find': clkdev.c:(.text+0xcf820): undefined reference to `cpufreq_next_valid' make[3]: *** [vmlinux] Error 1 Fix this making cpufreq_next_valid function inline and move it to cpufreq.h. Fixes: 27e289dce297 (cpufreq: Introduce macros for cpufreq_frequency_table iteration) Reported-and-tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 5eeaf1f1897372590105f155c6a7110b3fa36aef) Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Conflicts: include/linux/cpufreq.h
-rw-r--r--drivers/cpufreq/cpufreq.c11
-rw-r--r--include/linux/cpufreq.h10
2 files changed, 9 insertions, 12 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index b0d455d48dd4..b4cd3430a493 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -230,17 +230,6 @@ void cpufreq_cpu_put(struct cpufreq_policy *policy)
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
-bool cpufreq_next_valid(struct cpufreq_frequency_table **pos)
-{
- while ((*pos)->frequency != CPUFREQ_TABLE_END)
- if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID)
- return true;
- else
- (*pos)++;
- return false;
-}
-EXPORT_SYMBOL_GPL(cpufreq_next_valid);
-
/*********************************************************************
* EXTERNALLY AFFECTING FREQUENCY CHANGES *
*********************************************************************/
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index e8d7b6b7e3b7..c7b85eeaf4f1 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -446,7 +446,15 @@ struct cpufreq_frequency_table {
* order */
};
-bool cpufreq_next_valid(struct cpufreq_frequency_table **pos);
+static inline bool cpufreq_next_valid(struct cpufreq_frequency_table **pos)
+{
+ while ((*pos)->frequency != CPUFREQ_TABLE_END)
+ if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID)
+ return true;
+ else
+ (*pos)++;
+ return false;
+}
/*
* cpufreq_for_each_entry - iterate over a cpufreq_frequency_table