[LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()

Petr Vorel pvorel@suse.cz
Thu Apr 2 23:26:20 CEST 2026


Hi Cyril,

> This function allows us to check for presence of drivers build as
s/build/built/
> modules.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
>  include/tst_kernel.h | 10 ++++++++++
>  lib/tst_kernel.c     | 12 +++++++-----
>  2 files changed, 17 insertions(+), 5 deletions(-)

> diff --git a/include/tst_kernel.h b/include/tst_kernel.h
> index 63ecb19a4..d5a4a9625 100644
> --- a/include/tst_kernel.h
> +++ b/include/tst_kernel.h
> @@ -45,6 +45,16 @@ bool tst_abi_bits(int abi);
>   */
>  int tst_check_builtin_driver(const char *driver);

> +/**
> + * tst_check_module_driver() - Check if the kernel module is present.
> + *
> + * @driver: the name of the driver.
> + *
> + * Return: 0 if module driver is present or -1 when driver is missing or config file not
> + * available. On Android *always* 0 (always expect the module is present).

nit: "the driver" vs. "the module". We have kernel modules which are builtin or
compiled as modules. The older two functions say "the driver", but they are also
modules (although builtin), maybe worth to change it.

Kind regards,
Petr


More information about the ltp mailing list