diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-03-30 09:45:13 (GMT) |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-04-26 11:23:24 (GMT) |
commit | 4eb9b945c69fe1ccd6235e21c52627e1b741474a (patch) | |
tree | 0b2822fbe90d6de015fd1bbaeb9baa0fec8e23b1 /drivers/gpu/drm | |
parent | 5ff18e42ddfd9ab67088b2d7081380943b9f0cab (diff) | |
download | linux-4eb9b945c69fe1ccd6235e21c52627e1b741474a.tar.xz |
drm/sysfs: Annote lockless show functions with READ_ONCE
For documentation and paranoia.
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1459331120-27864-4-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_sysfs.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index d7d8cec..fa7fadc 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -208,9 +208,12 @@ static ssize_t status_show(struct device *device, char *buf) { struct drm_connector *connector = to_drm_connector(device); + enum drm_connector_status status; + + status = READ_ONCE(connector->status); return snprintf(buf, PAGE_SIZE, "%s\n", - drm_get_connector_status_name(connector->status)); + drm_get_connector_status_name(status)); } static ssize_t dpms_show(struct device *device, @@ -231,9 +234,11 @@ static ssize_t enabled_show(struct device *device, char *buf) { struct drm_connector *connector = to_drm_connector(device); + bool enabled; + + enabled = READ_ONCE(connector->encoder); - return snprintf(buf, PAGE_SIZE, "%s\n", connector->encoder ? "enabled" : - "disabled"); + return snprintf(buf, PAGE_SIZE, enabled ? "enabled\n" : "disabled\n"); } static ssize_t edid_show(struct file *filp, struct kobject *kobj, |