[igt-dev] [V4 i-g-t 14/24] tests/chamelium: Use drm_close_driver() to close the drm fd

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Jun 26 05:10:21 UTC 2023


To close the drm file descriptor, use igt helper drm_close_driver()
instead of using close().

Cc: Mark Yacoub <markyacoub at chromium.org>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/chamelium/kms_chamelium_audio.c  | 2 +-
 tests/chamelium/kms_chamelium_edid.c   | 2 +-
 tests/chamelium/kms_chamelium_frames.c | 2 +-
 tests/chamelium/kms_chamelium_hpd.c    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/chamelium/kms_chamelium_audio.c b/tests/chamelium/kms_chamelium_audio.c
index 6c6177fc5..8fbc1f80e 100644
--- a/tests/chamelium/kms_chamelium_audio.c
+++ b/tests/chamelium/kms_chamelium_audio.c
@@ -870,6 +870,6 @@ igt_main
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-		close(data.drm_fd);
+		drm_close_driver(data.drm_fd);
 	}
 }
diff --git a/tests/chamelium/kms_chamelium_edid.c b/tests/chamelium/kms_chamelium_edid.c
index 4a52e6922..446bbd204 100644
--- a/tests/chamelium/kms_chamelium_edid.c
+++ b/tests/chamelium/kms_chamelium_edid.c
@@ -585,6 +585,6 @@ igt_main
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-		close(data.drm_fd);
+		drm_close_driver(data.drm_fd);
 	}
 }
diff --git a/tests/chamelium/kms_chamelium_frames.c b/tests/chamelium/kms_chamelium_frames.c
index 22a7ba936..a56afada4 100644
--- a/tests/chamelium/kms_chamelium_frames.c
+++ b/tests/chamelium/kms_chamelium_frames.c
@@ -1102,6 +1102,6 @@ igt_main
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-		close(data.drm_fd);
+		drm_close_driver(data.drm_fd);
 	}
 }
diff --git a/tests/chamelium/kms_chamelium_hpd.c b/tests/chamelium/kms_chamelium_hpd.c
index efd40ba54..8b3189ca0 100644
--- a/tests/chamelium/kms_chamelium_hpd.c
+++ b/tests/chamelium/kms_chamelium_hpd.c
@@ -564,6 +564,6 @@ igt_main
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-		close(data.drm_fd);
+		drm_close_driver(data.drm_fd);
 	}
 }
-- 
2.40.0



More information about the igt-dev mailing list