X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fcpufreq%2Fhighbank-cpufreq.c;h=1608f7105c9f882c9e787b34a3aa270d9ace75e5;hb=d416462a618bdfd5d50bc564e2bc561a22479a5f;hp=9216c2020ec185280165dcee174f52f24900f9f2;hpb=6e030a4d929e8a7095debdaec8920ac879706ca8;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c index 9216c2020ec1..1608f7105c9f 100644 --- a/drivers/cpufreq/highbank-cpufreq.c +++ b/drivers/cpufreq/highbank-cpufreq.c @@ -6,7 +6,7 @@ * published by the Free Software Foundation. * * This driver provides the clk notifier callbacks that are used when - * the cpufreq-cpu0 driver changes to frequency to alert the highbank + * the cpufreq-dt driver changes to frequency to alert the highbank * EnergyCore Management Engine (ECME) about the need to change * voltage. The ECME interfaces with the actual voltage regulators. */ @@ -60,7 +60,7 @@ static struct notifier_block hb_cpufreq_clk_nb = { static int hb_cpufreq_driver_init(void) { - struct platform_device_info devinfo = { .name = "cpufreq-cpu0", }; + struct platform_device_info devinfo = { .name = "cpufreq-dt", }; struct device *cpu_dev; struct clk *cpu_clk; struct device_node *np; @@ -70,23 +70,17 @@ static int hb_cpufreq_driver_init(void) (!of_machine_is_compatible("calxeda,ecx-2000"))) return -ENODEV; - for_each_child_of_node(of_find_node_by_path("/cpus"), np) - if (of_get_property(np, "operating-points", NULL)) - break; - - if (!np) { - pr_err("failed to find highbank cpufreq node\n"); - return -ENOENT; - } - cpu_dev = get_cpu_device(0); if (!cpu_dev) { pr_err("failed to get highbank cpufreq device\n"); - ret = -ENODEV; - goto out_put_node; + return -ENODEV; } - cpu_dev->of_node = np; + np = of_node_get(cpu_dev->of_node); + if (!np) { + pr_err("failed to find highbank cpufreq node\n"); + return -ENOENT; + } cpu_clk = clk_get(cpu_dev, NULL); if (IS_ERR(cpu_clk)) { @@ -101,7 +95,7 @@ static int hb_cpufreq_driver_init(void) goto out_put_node; } - /* Instantiate cpufreq-cpu0 */ + /* Instantiate cpufreq-dt */ platform_device_register_full(&devinfo); out_put_node: