diff options
author | Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> | 2018-09-05 14:15:55 -0700 |
---|---|---|
committer | Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> | 2018-09-05 18:12:38 -0700 |
commit | 219b578bca04c93004e3f3942ce3079813f72724 (patch) | |
tree | 7249eeee59f10bb325449bc71de468c43e80fd9a /tests/kms_frontbuffer_tracking.c | |
parent | 86686c6e2f7c6f0944bced11550e06d20bc6957f (diff) |
lib/debugfs: Function to read debugfs with the directory already open
tests/kms_frontbuffer_tracking and tests/kms_psr read debugfs nodes
several times after opening the directory once. There is already an
implementation of this in the kms_frontbuffer_tracking, moving that
functionality to the library will allow us to share the code with kms_psr
and kms_fbcon_fbt
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r-- | tests/kms_frontbuffer_tracking.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 921aaffc..eab84926 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -720,12 +720,9 @@ static void set_mode_for_params(struct modeset_params *params) static void __debugfs_read(const char *param, char *buf, int len) { - len = igt_sysfs_read(drm.debugfs, param, buf, len - 1); - if (len < 0) { + len = igt_debugfs_simple_read(drm.debugfs, param, buf, len); + if (len < 0) igt_assert_eq(len, -ENODEV); - len = 0; - } - buf[len] = '\0'; } static int __debugfs_write(const char *param, char *buf, int len) |