Commit bb5710e7 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'pm-cpufreq'

* pm-cpufreq:
  cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable()
  cpufreq: cpufreq_register_driver() should return -ENODEV if init fails
parents 5ed02dbb 7575f825
...@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) ...@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
if (!(cpufreq_driver->flags & CPUFREQ_STICKY) && if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
list_empty(&cpufreq_policy_list)) { list_empty(&cpufreq_policy_list)) {
/* if all ->init() calls failed, unregister */ /* if all ->init() calls failed, unregister */
ret = -ENODEV;
pr_debug("%s: No CPU initialized for driver %s\n", __func__, pr_debug("%s: No CPU initialized for driver %s\n", __func__,
driver_data->name); driver_data->name);
goto err_if_unreg; goto err_if_unreg;
......
...@@ -127,7 +127,12 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) ...@@ -127,7 +127,12 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
return PTR_ERR(priv.cpu_clk); return PTR_ERR(priv.cpu_clk);
} }
clk_prepare_enable(priv.cpu_clk); err = clk_prepare_enable(priv.cpu_clk);
if (err) {
dev_err(priv.dev, "Unable to prepare cpuclk\n");
return err;
}
kirkwood_freq_table[0].frequency = clk_get_rate(priv.cpu_clk) / 1000; kirkwood_freq_table[0].frequency = clk_get_rate(priv.cpu_clk) / 1000;
priv.ddr_clk = of_clk_get_by_name(np, "ddrclk"); priv.ddr_clk = of_clk_get_by_name(np, "ddrclk");
...@@ -137,7 +142,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) ...@@ -137,7 +142,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
goto out_cpu; goto out_cpu;
} }
clk_prepare_enable(priv.ddr_clk); err = clk_prepare_enable(priv.ddr_clk);
if (err) {
dev_err(priv.dev, "Unable to prepare ddrclk\n");
goto out_cpu;
}
kirkwood_freq_table[1].frequency = clk_get_rate(priv.ddr_clk) / 1000; kirkwood_freq_table[1].frequency = clk_get_rate(priv.ddr_clk) / 1000;
priv.powersave_clk = of_clk_get_by_name(np, "powersave"); priv.powersave_clk = of_clk_get_by_name(np, "powersave");
...@@ -146,7 +155,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) ...@@ -146,7 +155,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
err = PTR_ERR(priv.powersave_clk); err = PTR_ERR(priv.powersave_clk);
goto out_ddr; goto out_ddr;
} }
clk_prepare_enable(priv.powersave_clk); err = clk_prepare_enable(priv.powersave_clk);
if (err) {
dev_err(priv.dev, "Unable to prepare powersave clk\n");
goto out_ddr;
}
of_node_put(np); of_node_put(np);
np = NULL; np = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment