aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_sysfs.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-06-05 18:27:30 -0400
committerDave Airlie <airlied@redhat.com>2015-06-05 18:27:30 -0400
commit38d8571dad8a759bdc051dbff747b189c90658cf (patch)
tree2c974617cfea69d8f1ebe156d4bce160d354abb5 /drivers/gpu/drm/drm_sysfs.c
parenta9592f17e87a8afbf8732f0ec4c4e1ff42d38d63 (diff)
drm: fix writing to /sys/class/drm/*/status
Writing to a file is supposed to return the number of bytes written. Returning zero unfortunately causes bash to constantly spin trying to write to the sysfs file, to such an extent that even ^c and ^z have no effect. The only way out of that is to kill the shell and log back in. This isn't nice behaviour. Fix it by returning the number of characters written to sysfs files. [airlied: used suggestion from Al Viro] Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_sysfs.c')
-rw-r--r--drivers/gpu/drm/drm_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index ffc305fc2076..eb7e61078a5b 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -217,7 +217,7 @@ static ssize_t status_store(struct device *device,
217 217
218 mutex_unlock(&dev->mode_config.mutex); 218 mutex_unlock(&dev->mode_config.mutex);
219 219
220 return ret; 220 return ret ? ret : count;
221} 221}
222 222
223static ssize_t status_show(struct device *device, 223static ssize_t status_show(struct device *device,