aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorEduardo Valentin <eduardo.valentin@ti.com>2013-04-17 13:11:59 -0400
committerZhang Rui <rui.zhang@intel.com>2013-04-26 21:25:32 -0400
commit79491e53dcd73175473e3293a574f5e006b468be (patch)
tree22faf751289e5ba42c7cc9c21d132c515985ba4f /drivers/thermal
parent79d264016ac011b74497b553022d2fc45bf9d9f2 (diff)
thermal: cpu_cooling: standardize end of function
Just for code readiness, this patch makes all functions on this file to have a blank line before their returns. Now, some functions follow this pattern, and others will not have a blank line. So, this patch makes it a single pattern. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/cpu_cooling.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 4b9be532cb14..bb32ca0056c4 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -64,6 +64,11 @@ static struct cpufreq_cooling_device *notify_device;
64 * get_idr - function to get a unique id. 64 * get_idr - function to get a unique id.
65 * @idr: struct idr * handle used to create a id. 65 * @idr: struct idr * handle used to create a id.
66 * @id: int * value generated by this function. 66 * @id: int * value generated by this function.
67 *
68 * This function will populate @id with an unique
69 * id, using the idr API.
70 *
71 * Return: 0 on success, an error code on failure.
67 */ 72 */
68static int get_idr(struct idr *idr, int *id) 73static int get_idr(struct idr *idr, int *id)
69{ 74{
@@ -75,6 +80,7 @@ static int get_idr(struct idr *idr, int *id)
75 if (unlikely(ret < 0)) 80 if (unlikely(ret < 0))
76 return ret; 81 return ret;
77 *id = ret; 82 *id = ret;
83
78 return 0; 84 return 0;
79} 85}
80 86
@@ -105,6 +111,7 @@ static void release_idr(struct idr *idr, int id)
105static int is_cpufreq_valid(int cpu) 111static int is_cpufreq_valid(int cpu)
106{ 112{
107 struct cpufreq_policy policy; 113 struct cpufreq_policy policy;
114
108 return !cpufreq_get_policy(&policy, cpu); 115 return !cpufreq_get_policy(&policy, cpu);
109} 116}
110 117
@@ -200,6 +207,7 @@ static int get_property(unsigned int cpu, unsigned long input,
200 } 207 }
201 j++; 208 j++;
202 } 209 }
210
203 return -EINVAL; 211 return -EINVAL;
204} 212}
205 213
@@ -220,6 +228,7 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq)
220 228
221 if (get_property(cpu, (unsigned long)freq, &val, GET_LEVEL)) 229 if (get_property(cpu, (unsigned long)freq, &val, GET_LEVEL))
222 return THERMAL_CSTATE_INVALID; 230 return THERMAL_CSTATE_INVALID;
231
223 return (unsigned long)val; 232 return (unsigned long)val;
224} 233}
225EXPORT_SYMBOL_GPL(cpufreq_cooling_get_level); 234EXPORT_SYMBOL_GPL(cpufreq_cooling_get_level);
@@ -244,6 +253,7 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level)
244 ret = get_property(cpu, level, &freq, GET_FREQ); 253 ret = get_property(cpu, level, &freq, GET_FREQ);
245 if (ret) 254 if (ret)
246 return 0; 255 return 0;
256
247 return freq; 257 return freq;
248} 258}
249 259
@@ -372,6 +382,7 @@ static int cpufreq_get_cur_state(struct thermal_cooling_device *cdev,
372 struct cpufreq_cooling_device *cpufreq_device = cdev->devdata; 382 struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;
373 383
374 *state = cpufreq_device->cpufreq_state; 384 *state = cpufreq_device->cpufreq_state;
385
375 return 0; 386 return 0;
376} 387}
377 388
@@ -474,6 +485,7 @@ struct thermal_cooling_device *cpufreq_cooling_register(
474 cpufreq_dev_count++; 485 cpufreq_dev_count++;
475 486
476 mutex_unlock(&cooling_cpufreq_lock); 487 mutex_unlock(&cooling_cpufreq_lock);
488
477 return cool_dev; 489 return cool_dev;
478} 490}
479EXPORT_SYMBOL_GPL(cpufreq_cooling_register); 491EXPORT_SYMBOL_GPL(cpufreq_cooling_register);