summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2019-11-28 15:55:36 +0100
committerLi Yang <leoyang.li@nxp.com>2019-12-09 20:54:35 +0100
commit002dedc5e933f6683b48de2f5702089c65b86bd1 (patch)
treeb03a10514fdcfc84927a90ae595461829a49b21b /drivers/tty
parentserial: ucc_uart: factor out soft_uart initialization (diff)
downloadlinux-002dedc5e933f6683b48de2f5702089c65b86bd1.tar.xz
linux-002dedc5e933f6683b48de2f5702089c65b86bd1.zip
serial: ucc_uart: stub out soft_uart_init for !CONFIG_PPC32
The Soft UART hack is only needed for some PPC-based SOCs. To allow building this driver for non-PPC, guard soft_uart_init() and its helpers by CONFIG_PPC32, and use a no-op soft_uart_init() otherwise. Reviewed-by: Timur Tabi <timur@kernel.org> Acked-by: Timur Tabi <timur@kernel.org> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/ucc_uart.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index f286e91714cb..313697842e24 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -33,7 +33,10 @@
#include <linux/firmware.h>
#include <soc/fsl/cpm.h>
-#include <asm/reg.h>
+
+#ifdef CONFIG_PPC32
+#include <asm/reg.h> /* mfspr, SPRN_SVR */
+#endif
/*
* The GUMR flag for Soft UART. This would normally be defined in qe.h,
@@ -1096,6 +1099,8 @@ static const struct uart_ops qe_uart_pops = {
.verify_port = qe_uart_verify_port,
};
+
+#ifdef CONFIG_PPC32
/*
* Obtain the SOC model number and revision level
*
@@ -1238,6 +1243,16 @@ static int soft_uart_init(struct platform_device *ofdev)
return 0;
}
+#else /* !CONFIG_PPC32 */
+
+static int soft_uart_init(struct platform_device *ofdev)
+{
+ return 0;
+}
+
+#endif
+
+
static int ucc_uart_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;