From 1bad7a0f0d37f63ed006779dfada68b45b8bd76d Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 7 Aug 2019 10:01:50 +0200 Subject: [PATCH] tests: mockup: don't fail at init-time if gpio-mockup is already loaded The comment in gpio_mockup_new() says we can deal with gpio-mockup already being loaded, but it's wrong - we'd actually fail in the call to kmod_module_probe_insert_module(). Pass the KMOD_PROBE_IGNORE_LOADED flag to the insert function to fix that. Signed-off-by: Bartosz Golaszewski --- tests/mockup/gpio-mockup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/mockup/gpio-mockup.c b/tests/mockup/gpio-mockup.c index 22a3a58..e3a53da 100644 --- a/tests/mockup/gpio-mockup.c +++ b/tests/mockup/gpio-mockup.c @@ -105,7 +105,8 @@ EXPORT struct gpio_mockup *gpio_mockup_new(void) * Then see if we can freely load and unload it. If it's already * loaded - no problem, we'll remove it next anyway. */ - rv = kmod_module_probe_insert_module(ctx->module, 0, + rv = kmod_module_probe_insert_module(ctx->module, + KMOD_PROBE_IGNORE_LOADED, "gpio_mockup_ranges=-1,4", NULL, NULL, NULL); if (rv) -- 2.30.2