aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2011-07-01 11:34:38 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-15 18:31:35 -0700
commitedf400e549fa34a2004612d9eee543747d73cb48 (patch)
treefcb293d18e8a20cbadda797cc93ab35abdd7fa8e /drivers/platform
parent2c4ee7699067b5f9d65e8d97d153daa5d0590365 (diff)
downloadkernel_samsung_espresso10-edf400e549fa34a2004612d9eee543747d73cb48.zip
kernel_samsung_espresso10-edf400e549fa34a2004612d9eee543747d73cb48.tar.gz
kernel_samsung_espresso10-edf400e549fa34a2004612d9eee543747d73cb48.tar.bz2
asus-wmi: return proper value in store_cpufv()
commit 3df5fdadf6400373a696bb14e27d4771e5f6afb3 upstream. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index f670361..e1678b9 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1165,14 +1165,18 @@ ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER);
static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
- int value;
+ int value, rv;
if (!count || sscanf(buf, "%i", &value) != 1)
return -EINVAL;
if (value < 0 || value > 2)
return -EINVAL;
- return asus_wmi_evaluate_method(ASUS_WMI_METHODID_CFVS, value, 0, NULL);
+ rv = asus_wmi_evaluate_method(ASUS_WMI_METHODID_CFVS, value, 0, NULL);
+ if (rv < 0)
+ return rv;
+
+ return count;
}
static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);