aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-09-25 08:11:14 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-10-08 13:51:01 +0800
commit2e2c514a40e956d857707f157201c5606c0e9da0 (patch)
tree0067c4268daef0c84f82e829da4ec3402a92093e /drivers/serial
parent7e45bb0867fd88ff044a71903882e6ff098dea11 (diff)
downloadu-boot-2e2c514a40e956d857707f157201c5606c0e9da0.zip
u-boot-2e2c514a40e956d857707f157201c5606c0e9da0.tar.gz
u-boot-2e2c514a40e956d857707f157201c5606c0e9da0.tar.bz2
serial: ns16550: Allow serial to enabled/disabled in SPL
At present this driver uses the wrong condition for including the code and drivers in SPL/TPL. Update it so that the code is only included if DM_SERIAL is enabled for SPL/TPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/ns16550.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 6cf2be8..01f3349 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -21,7 +21,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define UART_MCRVAL (UART_MCR_DTR | \
UART_MCR_RTS) /* RTS/DTR */
-#ifndef CONFIG_DM_SERIAL
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
#define serial_out(x, y) outb(x, (ulong)y)
#define serial_in(y) inb((ulong)y)
@@ -86,7 +86,7 @@ static inline int serial_in_shift(void *addr, int shift)
#endif
}
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
#ifndef CONFIG_SYS_NS16550_CLK
#define CONFIG_SYS_NS16550_CLK 0
@@ -301,7 +301,7 @@ DEBUG_UART_FUNCS
#endif
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
static int ns16550_serial_putc(struct udevice *dev, const char ch)
{
struct NS16550 *const com_port = dev_get_priv(dev);