clk: imx: scu: fix MXC_CLK_SCU module build break
authorDong Aisheng <aisheng.dong@nxp.com>
Mon, 30 Nov 2020 08:46:24 +0000 (16:46 +0800)
committerStephen Boyd <sboyd@kernel.org>
Mon, 7 Dec 2020 21:54:00 +0000 (13:54 -0800)
This issue can be reproduced by having a kernel config with
CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m.  It's caused by the Makefile
wanting to build clk-scu.o and clk-imx8qxp.o as different targets but
that doesn't work (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"

Having MXC_CLK_SCU=y/m while CLK_IMX8QXP=n will cause a linker problem
like below:

  LD [M]  drivers/clk/imx/clk-imx-scu.o
  arm-poky-linux-gnueabi-ld: no input files

Make MXC_CLK_SCU be un-selectable by users so it can only be selected by
the CLK_IMX8QXP option, ensuring the two symbols are built together.
Drop COMPILE_TEST too because this option isn't selectable anymore. We
can remove it from MXC_CLK_SCU because CLK_IMX8QXP selects MXC_CLK_SCU
which already has COMPILE_TEST.

Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Link: https://lore.kernel.org/r/20201130084624.21113-1-aisheng.dong@nxp.com
[sboyd@kernel.org: Rework commit text]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/imx/Kconfig

index 3b393cb07295134d9e8432cce9ba66e17c0ece2b..3061896503f300accf3dda9782864e2e19288c84 100644 (file)
@@ -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