aboutsummaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2008-10-30 19:10:08 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2008-11-06 19:05:37 -0800
commitea6ac1ac96a384b213d65c28d9e3d62f74b0267e (patch)
tree2b7800463715390f2d2473dcd539b8be14ac10d0 /drivers/base
parent4c49d126ab91fdd12801e216105fa35f5a915781 (diff)
sysfs: Fix return values for sysdev_store_{ulong, int}
commit 4e318d7c6c9dd5cdae48bcf61558bbc0c09b12ac upstream SYSFS: Fix return values for sysdev_store_{ulong,int} Always return the full size instead of the consumed length of the string in sysdev_store_{ulong,int} This avoids EINVAL errors in some echo versions. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 75dd6e22faf..70499cbc8eb 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -488,7 +488,8 @@ ssize_t sysdev_store_ulong(struct sys_device *sysdev,
if (end == buf)
return -EINVAL;
*(unsigned long *)(ea->var) = new;
- return end - buf;
+ /* Always return full write size even if we didn't consume all */
+ return size;
}
EXPORT_SYMBOL_GPL(sysdev_store_ulong);
@@ -511,7 +512,8 @@ ssize_t sysdev_store_int(struct sys_device *sysdev,
if (end == buf || new > INT_MAX || new < INT_MIN)
return -EINVAL;
*(int *)(ea->var) = new;
- return end - buf;
+ /* Always return full write size even if we didn't consume all */
+ return size;
}
EXPORT_SYMBOL_GPL(sysdev_store_int);