Commit 4eb9b945 authored by Daniel Vetter's avatar Daniel Vetter

drm/sysfs: Annote lockless show functions with READ_ONCE

For documentation and paranoia.
Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1459331120-27864-4-git-send-email-daniel.vetter@ffwll.ch
parent 5ff18e42
...@@ -208,9 +208,12 @@ static ssize_t status_show(struct device *device, ...@@ -208,9 +208,12 @@ static ssize_t status_show(struct device *device,
char *buf) char *buf)
{ {
struct drm_connector *connector = to_drm_connector(device); 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", 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, static ssize_t dpms_show(struct device *device,
...@@ -231,9 +234,11 @@ static ssize_t enabled_show(struct device *device, ...@@ -231,9 +234,11 @@ static ssize_t enabled_show(struct device *device,
char *buf) char *buf)
{ {
struct drm_connector *connector = to_drm_connector(device); 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" : return snprintf(buf, PAGE_SIZE, enabled ? "enabled\n" : "disabled\n");
"disabled");
} }
static ssize_t edid_show(struct file *filp, struct kobject *kobj, static ssize_t edid_show(struct file *filp, struct kobject *kobj,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment