diff options
author | Peter Boonstoppel <pboonstoppel@nvidia.com> | 2011-12-06 16:59:30 -0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-08 18:07:35 +0530 |
commit | 08580dde93cd93de07f8124c59fc3c8300f3e4ed (patch) | |
tree | 312cd8e611afe63afea21ade8c1516e1d3b5a145 /drivers/cpufreq | |
parent | 0f7d241b9a729c32c767d84071229222a0a5a2c0 (diff) |
cpufreq interactive governor: Fix attribute write bug
Attribute store functions used to return 0 upon success, but should
return count instead.
Change-Id: I2ab15e536d9affbf80bbcb2e557c6d217d5a9dfa
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/68554
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Tested-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index e87942831186..44e97a6816a9 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -494,7 +494,9 @@ 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) { - return strict_strtoul(buf, 0, &boost_factor); + if (!strict_strtoul(buf, 0, &boost_factor)) + return count; + return -EINVAL; } static struct global_attr boost_factor_attr = __ATTR(boost_factor, 0644, @@ -509,7 +511,9 @@ 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) { - return strict_strtoul(buf, 0, &max_boost); + if (!strict_strtoul(buf, 0, &max_boost)) + return count; + return -EINVAL; } static struct global_attr max_boost_attr = __ATTR(max_boost, 0644, @@ -525,7 +529,9 @@ 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) { - return strict_strtoul(buf, 0, &sustain_load); + if (!strict_strtoul(buf, 0, &sustain_load)) + return count; + return -EINVAL; } static struct global_attr sustain_load_attr = __ATTR(sustain_load, 0644, |