diff options
author | Peter Boonstoppel <pboonstoppel@nvidia.com> | 2012-02-16 17:55:41 -0800 |
---|---|---|
committer | Lokesh Pathak <lpathak@nvidia.com> | 2012-02-21 09:12:14 -0800 |
commit | 55f60eca1c6f3e29c8de1e778fb248b978e15768 (patch) | |
tree | 7538d97090663ada3651dd8ef6d1214b74e3046a | |
parent | b3c72246b83e346dd14bbebca6d96b07aae990e8 (diff) |
cpufreq interactive governor: Unify attribute store functions
Change our added attributes' store functions to Google style
Change-Id: I5dc641112085698918e87b52378fe3a5bfe44360
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/84452
Reviewed-by: Satya Popuri <spopuri@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index 44e97a6816a9..870c98848afe 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -494,9 +494,14 @@ static ssize_t show_boost_factor(struct kobject *kobj, static ssize_t store_boost_factor(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - if (!strict_strtoul(buf, 0, &boost_factor)) - return count; - return -EINVAL; + int ret; + unsigned long val; + + ret = strict_strtoul(buf, 0, &val); + if (ret < 0) + return ret; + boost_factor = val; + return count; } static struct global_attr boost_factor_attr = __ATTR(boost_factor, 0644, @@ -511,9 +516,14 @@ static ssize_t show_max_boost(struct kobject *kobj, static ssize_t store_max_boost(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - if (!strict_strtoul(buf, 0, &max_boost)) - return count; - return -EINVAL; + int ret; + unsigned long val; + + ret = strict_strtoul(buf, 0, &val); + if (ret < 0) + return ret; + max_boost = val; + return count; } static struct global_attr max_boost_attr = __ATTR(max_boost, 0644, @@ -529,9 +539,14 @@ static ssize_t show_sustain_load(struct kobject *kobj, static ssize_t store_sustain_load(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - if (!strict_strtoul(buf, 0, &sustain_load)) - return count; - return -EINVAL; + int ret; + unsigned long val; + + ret = strict_strtoul(buf, 0, &val); + if (ret < 0) + return ret; + sustain_load = val; + return count; } static struct global_attr sustain_load_attr = __ATTR(sustain_load, 0644, |