Subject: [PATCH 6.4 336/800] soc/fsl/qe: fix usb.c build errors

From: Greg Kroah-Hartman <[email-masked]>
Date: Sun, 16 Jul 2023 21:43:09 +0200

From: Randy Dunlap <[email-masked]>

[ Upstream commit 7b1a78babd0d2cd27aa07255dee0c2d7ac0f31e3 ]

Fix build errors in soc/fsl/qe/usb.c when QUICC_ENGINE is not set.
This happens when PPC_EP88XC is set, which selects CPM1 & CPM.
When CPM is set, USB_FSL_QE can be set without QUICC_ENGINE
being set. When USB_FSL_QE is set, QE_USB deafults to y, which
causes build errors when QUICC_ENGINE is not set. Making
QE_USB depend on QUICC_ENGINE prevents QE_USB from defaulting to y.

Fixes these build errors:

drivers/soc/fsl/qe/usb.o: in function `qe_usb_clock_set':
usb.c:(.text+0x1e): undefined reference to `qe_immr'
powerpc-linux-ld: usb.c:(.text+0x2a): undefined reference to `qe_immr'
powerpc-linux-ld: usb.c:(.text+0xbc): undefined reference to `qe_setbrg'
powerpc-linux-ld: usb.c:(.text+0xca): undefined reference to `cmxgcr_lock'
powerpc-linux-ld: usb.c:(.text+0xce): undefined reference to `cmxgcr_lock'

Fixes: 5e41486c408e ("powerpc/QE: add support for QE USB clocks routing")
Signed-off-by: Randy Dunlap <[email-masked]>
Reported-by: kernel test robot <[email-masked]>
Link: https://lore.kernel.org/all/[email-masked]/
Suggested-by: Michael Ellerman <[email-masked]>
Cc: Christophe Leroy <[email-masked]>
Cc: Leo Li <[email-masked]>
Cc: Masahiro Yamada <[email-masked]>
Cc: Nicolas Schier <[email-masked]>
Cc: Qiang Zhao <[email-masked]>
Cc: linuxppc-dev <[email-masked]>
Cc: [email-masked]
Cc: Kumar Gala <[email-masked]>
Acked-by: Nicolas Schier <[email-masked]>
Signed-off-by: Li Yang <[email-masked]>
Signed-off-by: Sasha Levin <[email-masked]>
---
 drivers/soc/fsl/qe/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/fsl/qe/Kconfig b/drivers/soc/fsl/qe/Kconfig
index e0d096607fefb..fa9ffbed0e929 100644
--- a/drivers/soc/fsl/qe/Kconfig
+++ b/drivers/soc/fsl/qe/Kconfig
@@ -62,6 +62,7 @@ config QE_TDM
 
 config QE_USB
 	bool
+	depends on QUICC_ENGINE
 	default y if USB_FSL_QE
 	help
 	  QE USB Controller support
-- 
2.39.2