ns16550: Guard accesses to vuart field by CONFIG_ARM

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>
This commit is contained in:
Shawn Anastasio authored and Jan Beulich committed 2023-08-09 09:04:24 +02:00
1 parent 82f7f7be46
commit f974004ccb
1 file changed
+2
+2
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.