From d781554969f1beaf69640e2af949e31a26ff682e Mon Sep 17 00:00:00 2001 From: Eduardo Valentin Date: Wed, 17 Apr 2013 17:11:59 +0000 Subject: [PATCH] --- yaml --- r: 374602 b: refs/heads/master c: 79491e53dcd73175473e3293a574f5e006b468be h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/thermal/cpu_cooling.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 87ff78e5070d..99e8550a38d5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 79d264016ac011b74497b553022d2fc45bf9d9f2 +refs/heads/master: 79491e53dcd73175473e3293a574f5e006b468be diff --git a/trunk/drivers/thermal/cpu_cooling.c b/trunk/drivers/thermal/cpu_cooling.c index 4b9be532cb14..bb32ca0056c4 100644 --- a/trunk/drivers/thermal/cpu_cooling.c +++ b/trunk/drivers/thermal/cpu_cooling.c @@ -64,6 +64,11 @@ static struct cpufreq_cooling_device *notify_device; * get_idr - function to get a unique id. * @idr: struct idr * handle used to create a id. * @id: int * value generated by this function. + * + * This function will populate @id with an unique + * id, using the idr API. + * + * Return: 0 on success, an error code on failure. */ static int get_idr(struct idr *idr, int *id) { @@ -75,6 +80,7 @@ static int get_idr(struct idr *idr, int *id) if (unlikely(ret < 0)) return ret; *id = ret; + return 0; } @@ -105,6 +111,7 @@ static void release_idr(struct idr *idr, int id) static int is_cpufreq_valid(int cpu) { struct cpufreq_policy policy; + return !cpufreq_get_policy(&policy, cpu); } @@ -200,6 +207,7 @@ static int get_property(unsigned int cpu, unsigned long input, } j++; } + return -EINVAL; } @@ -220,6 +228,7 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq) if (get_property(cpu, (unsigned long)freq, &val, GET_LEVEL)) return THERMAL_CSTATE_INVALID; + return (unsigned long)val; } EXPORT_SYMBOL_GPL(cpufreq_cooling_get_level); @@ -244,6 +253,7 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level) ret = get_property(cpu, level, &freq, GET_FREQ); if (ret) return 0; + return freq; } @@ -372,6 +382,7 @@ static int cpufreq_get_cur_state(struct thermal_cooling_device *cdev, struct cpufreq_cooling_device *cpufreq_device = cdev->devdata; *state = cpufreq_device->cpufreq_state; + return 0; } @@ -474,6 +485,7 @@ struct thermal_cooling_device *cpufreq_cooling_register( cpufreq_dev_count++; mutex_unlock(&cooling_cpufreq_lock); + return cool_dev; } EXPORT_SYMBOL_GPL(cpufreq_cooling_register);