Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355416
b: refs/heads/master
c: 3e27996
h: refs/heads/master
v: v3
  • Loading branch information
Ulf Hansson authored and Linus Walleij committed Jan 7, 2013
1 parent 1a78daf commit d991c7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84c7c20f608f9d6d315b5b8c7935fa2a9a57fa51
refs/heads/master: 3e27996ca876a4cf38b4821140819e962104f82c
29 changes: 14 additions & 15 deletions trunk/drivers/cpufreq/dbx500-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit d991c7c

Please sign in to comment.