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

regmap: Provide user selectable option to enable regmap

Since apparently enabling all the KUnit tests shouldn't enable any new
subsystems it is hard to enable the regmap KUnit tests in normal KUnit
testing scenarios that don't enable any drivers. Add a Kconfig option
to help with this and include it in the KUnit all tests config.

Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230712-regmap-kunit-enable-v1-1-13e296bd0204@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

+13 -1
+11 -1
drivers/base/regmap/Kconfig
··· 4 4 # subsystems should select the appropriate symbols. 5 5 6 6 config REGMAP 7 - bool "Register Map support" if KUNIT_ALL_TESTS 7 + bool 8 8 default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SOUNDWIRE_MBQ || REGMAP_SCCB || REGMAP_I3C || REGMAP_SPI_AVMM || REGMAP_MDIO || REGMAP_FSI) 9 9 select IRQ_DOMAIN if REGMAP_IRQ 10 10 select MDIO_BUS if REGMAP_MDIO ··· 22 22 depends on KUNIT && REGMAP 23 23 default KUNIT_ALL_TESTS 24 24 select REGMAP_RAM 25 + 26 + config REGMAP_BUILD 27 + bool "Enable regmap build" 28 + depends on KUNIT 29 + select REGMAP 30 + help 31 + This option exists purely to allow the regmap KUnit tests to 32 + be enabled without having to enable some driver that uses 33 + regmap due to unfortunate issues with how KUnit tests are 34 + normally enabled. 25 35 26 36 config REGMAP_AC97 27 37 tristate
+2
tools/testing/kunit/configs/all_tests.config
··· 33 33 CONFIG_DEBUG_FS=y 34 34 CONFIG_DAMON_DBGFS=y 35 35 36 + CONFIG_REGMAP_BUILD=y 37 + 36 38 CONFIG_SECURITY=y 37 39 CONFIG_SECURITY_APPARMOR=y