thunderbolt: Allow KUnit tests to be built also when CONFIG_USB4=m
[linux-2.6-microblaze.git] / drivers / thunderbolt / test.c
index acb8b62..464c2d3 100644 (file)
@@ -17,13 +17,13 @@ static int __ida_init(struct kunit_resource *res, void *context)
        struct ida *ida = context;
 
        ida_init(ida);
-       res->allocation = ida;
+       res->data = ida;
        return 0;
 }
 
 static void __ida_destroy(struct kunit_resource *res)
 {
-       struct ida *ida = res->allocation;
+       struct ida *ida = res->data;
 
        ida_destroy(ida);
 }
@@ -1623,4 +1623,15 @@ static struct kunit_suite tb_test_suite = {
        .name = "thunderbolt",
        .test_cases = tb_test_cases,
 };
-kunit_test_suite(tb_test_suite);
+
+static struct kunit_suite *tb_test_suites[] = { &tb_test_suite, NULL };
+
+int tb_test_init(void)
+{
+       return __kunit_test_suites_init(tb_test_suites);
+}
+
+void tb_test_exit(void)
+{
+       return __kunit_test_suites_exit(tb_test_suites);
+}