From 219b578bca04c93004e3f3942ce3079813f72724 Mon Sep 17 00:00:00 2001 From: Dhinakaran Pandiyan Date: Wed, 5 Sep 2018 14:15:55 -0700 Subject: lib/debugfs: Function to read debugfs with the directory already open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: José Roberto de Souza --- tests/kms_frontbuffer_tracking.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tests/kms_frontbuffer_tracking.c') 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) -- cgit v1.2.3