summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq_interactive.c33
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,