[PATCH i-g-t v1 6/7] tests/core_hotunplug: Fix device close

Kamil Konieczny kamil.konieczny at linux.intel.com
Fri Jun 7 15:36:18 UTC 2024


Use __drm_device_close for closing a drm device, as for Xe driver
it needs to call additional function.

Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 tests/core_hotunplug.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index ddf11bb00..3b0135fc8 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -146,7 +146,11 @@ static int close_device(int fd_drm, const char *when, const char *which)
 		return fd_drm;
 
 	local_debug("%sclosing %sdevice instance\n", when, which);
-	return local_close(fd_drm, "Device close failed");
+	errno = 0;
+	if (igt_warn_on_f(__drm_close_driver(fd_drm), "Device close failed\n"))
+		return -errno;	/* (never -1) */
+
+	return -1;	/* success */
 }
 
 static int close_sysfs(int fd_sysfs_dev)
-- 
2.43.0



More information about the igt-dev mailing list