From 089d795364c7c9f07720567b09462b8dec367ae5 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Mon, 6 Jun 2011 18:59:02 -0700 Subject: [PATCH] --- yaml --- r: 258579 b: refs/heads/master c: 4911ca1031c2ade225fdf22cc872bc121c2c2ec5 h: refs/heads/master i: 258577: c2239cc5c7c5f7ab6d5163980f48679ef0fb6f3a 258575: 4c133447eebf4a68fa713d63107e2d4c69403052 v: v3 --- [refs] | 2 +- trunk/drivers/cpufreq/s5pv210-cpufreq.c | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 9308538aea59..5cc9954a87d7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 15964d388528c1dbb672027c8003fe7e81630a35 +refs/heads/master: 4911ca1031c2ade225fdf22cc872bc121c2c2ec5 diff --git a/trunk/drivers/cpufreq/s5pv210-cpufreq.c b/trunk/drivers/cpufreq/s5pv210-cpufreq.c index ea35d3f74e3d..a7cb3385bf5e 100644 --- a/trunk/drivers/cpufreq/s5pv210-cpufreq.c +++ b/trunk/drivers/cpufreq/s5pv210-cpufreq.c @@ -415,6 +415,7 @@ static int check_mem_type(void __iomem *dmc_reg) static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) { unsigned long mem_type; + int ret; cpu_clk = clk_get(NULL, "armclk"); if (IS_ERR(cpu_clk)) @@ -422,19 +423,20 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) dmc0_clk = clk_get(NULL, "sclk_dmc0"); if (IS_ERR(dmc0_clk)) { - clk_put(cpu_clk); - return PTR_ERR(dmc0_clk); + ret = PTR_ERR(dmc0_clk); + goto out_dmc0; } dmc1_clk = clk_get(NULL, "hclk_msys"); if (IS_ERR(dmc1_clk)) { - clk_put(dmc0_clk); - clk_put(cpu_clk); - return PTR_ERR(dmc1_clk); + ret = PTR_ERR(dmc1_clk); + goto out_dmc1; } - if (policy->cpu != 0) - return -EINVAL; + if (policy->cpu != 0) { + ret = -EINVAL; + goto out_dmc1; + } /* * check_mem_type : This driver only support LPDDR & LPDDR2. @@ -444,7 +446,8 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) if ((mem_type != LPDDR) && (mem_type != LPDDR2)) { printk(KERN_ERR "CPUFreq doesn't support this memory type\n"); - return -EINVAL; + ret = -EINVAL; + goto out_dmc1; } /* Find current refresh counter and frequency each DMC */ @@ -461,6 +464,12 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 40000; return cpufreq_frequency_table_cpuinfo(policy, s5pv210_freq_table); + +out_dmc1: + clk_put(dmc0_clk); +out_dmc0: + clk_put(cpu_clk); + return ret; } static struct cpufreq_driver s5pv210_driver = {