drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module
authorArnd Bergmann <arnd@arndb.de>
Thu, 2 Feb 2023 10:23:32 +0000 (11:23 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 2 Feb 2023 12:37:26 +0000 (13:37 +0100)
commit352683ea52e3f299a72899c9ee059190c9f769a8
tree29111dd280b1870e7a9682018b8009b02615fde1
parent84cc4c7aecc4c6a17ea1030c49199ad7dc0a6b55
drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module

In configurations with CONFIG_KUNIT=m, builting the unit test
into the kernel causes a link failure:

arm-linux-gnueabi-ld: drivers/gpu/drm/vc4/tests/vc4_mock.o: in function `__build_mock':
vc4_mock.c:(.text+0x6e): undefined reference to `kunit_do_failed_assertion'
arm-linux-gnueabi-ld: vc4_mock.c:(.text+0x9c): undefined reference to `kunit_do_failed_assertion'
arm-linux-gnueabi-ld: vc4_mock.c:(.text+0x100): undefined reference to `kunit_ptr_not_err_assert_format'
...

Allow this to be a loadable module as well to have Kconfig
sort out the dependencies correctly.

Fixes: f759f5b53f1c ("drm/vc4: tests: Introduce a mocking infrastructure")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230202102346.868771-1-arnd@kernel.org
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/Kconfig