summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-05-18 22:06:40 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-05-21 13:44:24 +0200
commita413d2cea1cf35eda1c2ac2aff85791b99937447 (patch)
treea55427de032971425e80a2398d452c445d9aac5d /drivers/cpufreq
parentcpufreq: tegra20: Remove unneeded variable initialization (diff)
downloadlinux-a413d2cea1cf35eda1c2ac2aff85791b99937447.tar.xz
linux-a413d2cea1cf35eda1c2ac2aff85791b99937447.zip
cpufreq: tegra20: Check if this is Tegra20 machine
Don't even try to request the clocks during of module initialization on non-Tegra20 machines (this is the case for a multi-platform kernel) for consistency. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/tegra20-cpufreq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c
index 36075aee2ff2..7b425ebe81e7 100644
--- a/drivers/cpufreq/tegra20-cpufreq.c
+++ b/drivers/cpufreq/tegra20-cpufreq.c
@@ -21,6 +21,7 @@
#include <linux/err.h>
#include <linux/init.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/types.h>
static struct cpufreq_frequency_table freq_table[] = {
@@ -158,6 +159,9 @@ static int __init tegra_cpufreq_init(void)
{
int err;
+ if (!of_machine_is_compatible("nvidia,tegra20"))
+ return -ENODEV;
+
cpu_clk = clk_get_sys(NULL, "cclk");
if (IS_ERR(cpu_clk))
return PTR_ERR(cpu_clk);