summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/dbx500-cpufreq.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2012-12-10 16:25:40 +0100
committerLinus Walleij <linus.walleij@linaro.org>2013-01-07 16:03:20 +0100
commit3e27996ca876a4cf38b4821140819e962104f82c (patch)
tree948fa9bab2d0b1253df452ca28c3a9bbc8f91989 /drivers/cpufreq/dbx500-cpufreq.c
parent84c7c20f608f9d6d315b5b8c7935fa2a9a57fa51 (diff)
cpufreq: dbx500: Move clk_get to probe
The armss clock shall only be fetched at probe thus move this here. Same thing goes for the printing of the available frequencies. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Jonas Aaberg <jonas.aberg@stericsson.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/cpufreq/dbx500-cpufreq.c')
-rw-r--r--drivers/cpufreq/dbx500-cpufreq.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 0a411b54972a..d974a8e32d85 100644
--- a/drivers/cpufreq/dbx500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -90,28 +90,14 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)
static int __cpuinit dbx500_cpufreq_init(struct cpufreq_policy *policy)
{
- int i = 0;
int res;
- armss_clk = clk_get(NULL, "armss");
- if (IS_ERR(armss_clk)) {
- pr_err("dbx500-cpufreq : Failed to get armss clk\n");
- return PTR_ERR(armss_clk);
- }
-
- pr_info("dbx500-cpufreq : Available frequencies:\n");
- while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
- pr_info(" %d Mhz\n", freq_table[i].frequency/1000);
- i++;
- }
-
/* get policy fields based on the table */
res = cpufreq_frequency_table_cpuinfo(policy, freq_table);
if (!res)
cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
else {
pr_err("dbx500-cpufreq : Failed to read policy table\n");
- clk_put(armss_clk);
return res;
}
@@ -147,13 +133,26 @@ static struct cpufreq_driver dbx500_cpufreq_driver = {
static int dbx500_cpufreq_probe(struct platform_device *pdev)
{
- freq_table = dev_get_platdata(&pdev->dev);
+ int i = 0;
+ freq_table = dev_get_platdata(&pdev->dev);
if (!freq_table) {
pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n");
return -ENODEV;
}
+ armss_clk = clk_get(&pdev->dev, "armss");
+ if (IS_ERR(armss_clk)) {
+ pr_err("dbx500-cpufreq : Failed to get armss clk\n");
+ return PTR_ERR(armss_clk);
+ }
+
+ pr_info("dbx500-cpufreq : Available frequencies:\n");
+ while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
+ pr_info(" %d Mhz\n", freq_table[i].frequency/1000);
+ i++;
+ }
+
return cpufreq_register_driver(&dbx500_cpufreq_driver);
}