[PATCH i-g-t 02/10] lib/igt_kmod: Fix comment about unbound devices
Lucas De Marchi
lucas.demarchi at intel.com
Thu Apr 10 22:48:31 UTC 2025
If the module is loaded, the directory should exist, without any device
link. Example:
# cat /sys/module/xe/refcnt
0
# ls -l /sys/module/xe/drivers/pci\:xe/
total 0
--w------- 1 root root 4096 Apr 10 22:12 bind
lrwxrwxrwx 1 root root 0 Apr 10 22:12 module -> ../../../../module/xe
--w------- 1 root root 4096 Apr 10 22:12 new_id
--w------- 1 root root 4096 Apr 10 22:12 remove_id
--w------- 1 root root 4096 Apr 10 22:12 uevent
--w------- 1 root root 4096 Apr 10 22:12 unbind
The case in which the directory doesn't exist is when the module is not
loaded.
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
lib/igt_kmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 4e1a3d42d..ecc74e0fe 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -667,7 +667,7 @@ int igt_kmod_unbind(const char *mod_name, const char *pci_device)
dir = opendir(path);
- /* Module may be loaded, but without any device bound */
+ /* Module not loaded, nothing to unbind */
if (!dir)
return 0;
--
2.49.0
More information about the igt-dev
mailing list