Skip to content

Commit

Permalink
drm: fix writing to /sys/class/drm/*/status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Dave Airlie committed Jun 5, 2015
1 parent a9592f1 commit 38d8571
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static ssize_t status_store(struct device *device,

mutex_unlock(&dev->mode_config.mutex);

return ret;
return ret ? ret : count;
}

static ssize_t status_show(struct device *device,
Expand Down

0 comments on commit 38d8571

Please sign in to comment.