[PATCH] mux: mmio: depends on REGMAP
From: Randy Dunlap
Date: Wed Jul 27 2022 - 20:06:05 EST
Fix build error when CONFIG_REGMAP is not set/enabled:
../drivers/mux/mmio.c: In function ‘mux_mmio_probe’:
../drivers/mux/mmio.c:76:34: error: storage size of ‘field’ isn’t known
76 | struct reg_field field;
../drivers/mux/mmio.c:102:29: error: implicit declaration of function ‘devm_regmap_field_alloc’ [-Werror=implicit-function-declaration]
102 | fields[i] = devm_regmap_field_alloc(dev, regmap, field);
../drivers/mux/mmio.c:76:34: warning: unused variable ‘field’ [-Wunused-variable]
76 | struct reg_field field;
Most drivers that use REGMAP select it, but trying to use 'select'
here causes a ton of recursive/circular dependency chains, so just
use "depends on" to prevent the build errors.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Fixes: 73726380a26f ("mux: mmio-based syscon mux controller")
Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
Cc: Peter Rosin <peda@xxxxxxxxxx>
---
drivers/mux/Kconfig | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/mux/Kconfig
+++ b/drivers/mux/Kconfig
@@ -48,6 +48,7 @@ config MUX_GPIO
config MUX_MMIO
tristate "MMIO/Regmap register bitfield-controlled Multiplexer"
depends on OF || COMPILE_TEST
+ depends on REGMAP
help
MMIO/Regmap register bitfield-controlled Multiplexer controller.