From f8bf86c95fd17405a388ccca2bd7e5315f3df0fc Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 3 Mar 2016 10:14:49 -0800 Subject: [PATCH] uart: serial_ns16550: exclude driver data variables under #ifdef Not all of the variables defined in the driver data structure are required. So put some #ifdef around them. Change-Id: I08a0c02d9e5c6885d9b4d6237446bdb9b98f3bfa Signed-off-by: Daniel Leung --- drivers/serial/uart_ns16550.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c index 53417621a8b..543f7a031c7 100644 --- a/drivers/serial/uart_ns16550.c +++ b/drivers/serial/uart_ns16550.c @@ -208,9 +208,13 @@ struct uart_ns16550_dev_data_t { uint32_t baud_rate; /**< Baud rate */ uint8_t options; /**< Serial port options */ +#ifdef CONFIG_UART_INTERRUPT_DRIVEN uint8_t iir_cache; /**< cache of IIR since it clears when read */ +#endif + +#ifdef CONFIG_UART_NS16550_DLF uint8_t dlf; /**< DLF value */ - uint8_t stride; /**< structure stride padding */ +#endif }; static struct uart_driver_api uart_ns16550_driver_api; @@ -295,7 +299,9 @@ static int uart_ns16550_init(struct device *dev) return DEV_INVALID_OP; } +#ifdef CONFIG_UART_INTERRUPT_DRIVEN dev_data->iir_cache = 0; +#endif old_level = irq_lock();