summaryrefslogtreecommitdiff
path: root/lib/igt_kmod.c
diff options
context:
space:
mode:
authorJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>2024-01-25 12:51:26 +0100
committerJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>2024-02-14 16:34:39 +0100
commit2e3048e3d02f9ac13d1d2a3cf0017de9f5490373 (patch)
treeadafeeb46a6e5880fcbdf007c606916cc7a15917 /lib/igt_kmod.c
parent5d679504324380e0eff278f39e56b710682d72ad (diff)
lib/kmode: Prepare open_parameters() helper for reuse by kunit
Move the open_parameters() helper code up in the source file, above the kunit related functions, so it is available to follow-up changes of the kunit code. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Diffstat (limited to 'lib/igt_kmod.c')
-rw-r--r--lib/igt_kmod.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index ec9f77ba1..5a3bd9cf3 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -803,6 +803,14 @@ void igt_kselftest_get_tests(struct kmod_module *kmod,
kmod_module_info_free_list(pre);
}
+static int open_parameters(const char *module_name)
+{
+ char path[256];
+
+ snprintf(path, sizeof(path), "/sys/module/%s/parameters", module_name);
+ return open(path, O_RDONLY);
+}
+
struct modprobe_data {
struct kmod_module *kmod;
const char *opts;
@@ -1393,14 +1401,6 @@ void igt_kunit(const char *module_name, const char *name, const char *opts)
igt_ktest_fini(&tst);
}
-static int open_parameters(const char *module_name)
-{
- char path[256];
-
- snprintf(path, sizeof(path), "/sys/module/%s/parameters", module_name);
- return open(path, O_RDONLY);
-}
-
int igt_ktest_init(struct igt_ktest *tst,
const char *module_name)
{