diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-08-24 11:46:52 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-09-16 13:57:46 +0200 |
commit | 2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2 (patch) | |
tree | 7120f7cb51581c70ed207203cccb28145740a666 /drivers/thunderbolt/tb.h | |
parent | thunderbolt: Only stop control channel when entering freeze (diff) | |
download | linux-2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2.tar.xz linux-2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2.zip |
thunderbolt: Allow KUnit tests to be built also when CONFIG_USB4=m
This adds a bit more build coverage for the tests even though these are
not expected to be enabled by normal users and distros. In order to make
this working we need to open-code kunit_test_suite() and call the
relevant functions directly in the driver init/exit hook.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.h')
-rw-r--r-- | drivers/thunderbolt/tb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index 8b04a9deffc7..5687bcf38a9e 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h @@ -1030,4 +1030,12 @@ static inline void tb_switch_debugfs_init(struct tb_switch *sw) { } static inline void tb_switch_debugfs_remove(struct tb_switch *sw) { } #endif +#ifdef CONFIG_USB4_KUNIT_TEST +int tb_test_init(void); +void tb_test_exit(void); +#else +static inline int tb_test_init(void) { return 0; } +static inline void tb_test_exit(void) { } +#endif + #endif |