diff mbox series

[6/9] ns16550: Guard accesses to `vuart` field by CONFIG_ARM

Message ID 1bee2fe06c4a9262b05cb4b8cd392d9630279f30.1691016993.git.sanastasio@raptorengineering.com (mailing list archive)
State Superseded
Headers show
Series ppc: Enable full Xen build | expand

Commit Message

Shawn Anastasio Aug. 2, 2023, 11:03 p.m. UTC
When CONFIG_ARM is defined, a `vuart` field is added to struct ns16550,
but accesses to this field in ns16550_uart_dt_init weren't correctly
guarded. Fix build on !ARM platforms that define CONFIG_HAS_DEVICE_TREE
by correctly guarding access to the vuart field in this function.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich Aug. 8, 2023, 10:05 a.m. UTC | #1
On 03.08.2023 01:03, Shawn Anastasio wrote:
> When CONFIG_ARM is defined, a `vuart` field is added to struct ns16550,
> but accesses to this field in ns16550_uart_dt_init weren't correctly
> guarded. Fix build on !ARM platforms that define CONFIG_HAS_DEVICE_TREE
> by correctly guarding access to the vuart field in this function.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 212a9c49ae..c0598efb27 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1797,11 +1797,13 @@  static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
 
+#ifdef CONFIG_ARM
     uart->vuart.base_addr = uart->io_base;
     uart->vuart.size = uart->io_size;
     uart->vuart.data_off = UART_THR <<uart->reg_shift;
     uart->vuart.status_off = UART_LSR<<uart->reg_shift;
     uart->vuart.status = UART_LSR_THRE|UART_LSR_TEMT;
+#endif
 
     /* Register with generic serial driver. */
     serial_register_uart(uart - ns16550_com, &ns16550_driver, uart);