[PATCH] powercap: intel_rapl: fix CONFIG_IOSF_MBI dependency

From: Arnd Bergmann
Date: Thu Jun 01 2023 - 17:32:56 EST


From: Arnd Bergmann <arnd@xxxxxxxx>

When the intel_rapl driver is built-in, but iosf_mbi is a loadable module,
the kernel fails to link:

x86_64-linux-ld: vmlinux.o: in function `set_floor_freq_atom':
intel_rapl_common.c:(.text+0x2dac9b8): undefined reference to `iosf_mbi_write'
x86_64-linux-ld: intel_rapl_common.c:(.text+0x2daca66): undefined reference to `iosf_mbi_read'

The driver can work with iosf_mbi completely disabled, so add a dependency
that still allows this configuration, but otherwise forces it to not be
built-in when iosf_mbi is a loadable module.

Fixes: 9eef7f9da928c ("powercap: intel_rapl: Introduce RAPL TPMI interface driver")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
drivers/powercap/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/powercap/Kconfig b/drivers/powercap/Kconfig
index e71399804c143..21ad50b22d6b9 100644
--- a/drivers/powercap/Kconfig
+++ b/drivers/powercap/Kconfig
@@ -36,6 +36,7 @@ config INTEL_RAPL
config INTEL_RAPL_TPMI
tristate "Intel RAPL Support via TPMI Interface"
depends on X86
+ depends on IOSF_MBI || IOSF_MBI=n
depends on INTEL_TPMI
select INTEL_RAPL_CORE
help
--
2.39.2