[PATCH v2 1/1] clk: imx: scu: fix MXC_CLK_SCU module build break

Dong Aisheng aisheng.dong at nxp.com
Mon Nov 30 03:46:24 EST 2020


This issue can be reproduced by CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m.
It's caused by current Makefile writing can't support build clk-scu.o and
clk-imx8qxp.o independently. (e.g. MXC_CLK_SCU = y while CLK_IMX8QXP = n)

"obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o
clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o"

Only enable MXC_CLK_SCU while CLK_IMX8QXP not will cause unable to locate
the input files during linking.

Error log:
  LD [M]  drivers/clk/imx/clk-imx-scu.o
arm-poky-linux-gnueabi-ld: no input files
../scripts/Makefile.build:434: recipe for target 'drivers/clk/imx/clk-imx-scu.o' failed
make[4]: *** [drivers/clk/imx/clk-imx-scu.o] Error 1

This patch makes MXC_CLK_SCU to be invisible to users and can only be
selected by CLK_IMX8QXP option to ensure they're built together.

And COMPILE_TEST on an option that isn't selectable is meaningless.
We can remove it from MXC_CLK_SCU because CLK_IMX8QXP selecting MXC_CLK_SCU
already has COMPILE_TEST.

Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
Acked-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>
---
ChangeLog:
v1->v2:
 * remove COMPILE_TEST
---
 drivers/clk/imx/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig
index 3b393cb07295..3061896503f3 100644
--- a/drivers/clk/imx/Kconfig
+++ b/drivers/clk/imx/Kconfig
@@ -5,8 +5,8 @@ config MXC_CLK
 	depends on ARCH_MXC || COMPILE_TEST
 
 config MXC_CLK_SCU
-	tristate "IMX SCU clock"
-	depends on ARCH_MXC || COMPILE_TEST
+	tristate
+	depends on ARCH_MXC
 	depends on IMX_SCU && HAVE_ARM_SMCCC
 
 config CLK_IMX1
-- 
2.23.0




More information about the linux-arm-kernel mailing list