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>
This commit is contained in:
Dmitry Osipenko 2018-05-18 23:06:40 +03:00 committed by Rafael J. Wysocki
parent f39d4d5ed3
commit a413d2cea1
1 changed files with 4 additions and 0 deletions

View File

@ -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);