Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: test: fix missing MODULE_LICENSE for IIO_RESCALE=m

When IIO_RESCALE_KUNIT_TEST=y and IIO_RESCALE=m,
drivers/iio/afe/iio-rescale.o is built twice causing the
MODULE_LICENSE() to be lost, as shown by:

ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o

Rework the build configuration to have the dependency specified in the
Kconfig.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: 8e74a48d17d5 ("iio: test: add basic tests for the iio-rescale driver")
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20220601142138.3331278-1-liambeguin@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Liam Beguin and committed by
Jonathan Cameron
7a2f6f61 10b9c2c3

+2 -2
+1 -1
drivers/iio/test/Kconfig
··· 6 6 # Keep in alphabetical order 7 7 config IIO_RESCALE_KUNIT_TEST 8 8 bool "Test IIO rescale conversion functions" 9 - depends on KUNIT=y && !IIO_RESCALE 9 + depends on KUNIT=y && IIO_RESCALE=y 10 10 default KUNIT_ALL_TESTS 11 11 help 12 12 If you want to run tests on the iio-rescale code say Y here.
+1 -1
drivers/iio/test/Makefile
··· 4 4 # 5 5 6 6 # Keep in alphabetical order 7 - obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o ../afe/iio-rescale.o 7 + obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o 8 8 obj-$(CONFIG_IIO_TEST_FORMAT) += iio-test-format.o 9 9 CFLAGS_iio-test-format.o += $(DISABLE_STRUCTLEAK_PLUGIN)