summaryrefslogtreecommitdiff
path: root/overlay/rc6.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-20 11:08:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-20 11:08:13 +0100
commitc888507b68c665e15d02defae9d341245c87b1c2 (patch)
treed6569ca2b755599f75326fab5baf8385bdaa96e4 /overlay/rc6.c
parentcf62d52eb414db54c7dd8c78e3052fbad30f94fb (diff)
overlay: use rc6_enable to drop useless information
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/rc6.c')
-rw-r--r--overlay/rc6.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/overlay/rc6.c b/overlay/rc6.c
index 4bece6c0..1fea4444 100644
--- a/overlay/rc6.c
+++ b/overlay/rc6.c
@@ -63,11 +63,12 @@ int rc6_update(struct rc6 *rc6)
if (rc6->error)
return rc6->error;
- if (stat("/sys/class/drm/card0/power", &st) < 0)
- return rc6->error = errno;
-
if (stat("/sys/class/drm/card0/power/rc6_residency_ms", &st) < 0)
- return ENOENT;
+ return rc6->error = ENOENT;
+
+ rc6->enabled = file_to_u64("/sys/class/drm/card0/power/rc6_enable");
+ if (rc6->enabled == 0)
+ return EAGAIN;
s->rc6_residency = file_to_u64("/sys/class/drm/card0/power/rc6_residency_ms");
s->rc6p_residency = file_to_u64("/sys/class/drm/card0/power/rc6p_residency_ms");