From d32ac6ea9d4bb79c177ec947bcf839f71d1106c1 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 3 Mar 2026 18:24:42 +0800 Subject: [PATCH] serial/uart_rpmsg: Remove redundant CONFIG_RPMSG_UART_CONSOLE macro check Remove the unnecessary CONFIG_RPMSG_UART_CONSOLE preprocessor guard around the console registration logic in uart_rpmsg_init(). The uart_rpmsg_init() function already accepts a bool isconsole parameter to dynamically control console registration, which is designed to support flexible console setup in distributed multi-core SOC systems. Adding the macro check on top of this runtime parameter is redundant and negates the dynamic registration capability. This change fixes a regression introduced by PR #18410, which broke the functionality of sim/rpproxy and sim/rpserver due to the incorrect macro guard preventing proper console registration for the rpmsg UART device. Signed-off-by: chao an --- drivers/serial/uart_rpmsg.c | 2 -- drivers/serial/uart_rpmsg_raw.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/serial/uart_rpmsg.c b/drivers/serial/uart_rpmsg.c index 12205c232af..2fc7d273f38 100644 --- a/drivers/serial/uart_rpmsg.c +++ b/drivers/serial/uart_rpmsg.c @@ -458,12 +458,10 @@ int uart_rpmsg_init(FAR const char *cpuname, FAR const char *devname, UART_RPMSG_DEV_PREFIX, devname); uart_register(name, dev); - #ifdef CONFIG_RPMSG_UART_CONSOLE if (dev->isconsole) { uart_register(UART_RPMSG_DEV_CONSOLE, dev); } - #endif return 0; } diff --git a/drivers/serial/uart_rpmsg_raw.c b/drivers/serial/uart_rpmsg_raw.c index a658b3f61d3..8e40b2b9600 100644 --- a/drivers/serial/uart_rpmsg_raw.c +++ b/drivers/serial/uart_rpmsg_raw.c @@ -369,12 +369,10 @@ int uart_rpmsg_raw_init(FAR const char *cpuname, FAR const char *devname, UART_RPMSG_DEV_PREFIX, devname); uart_register(name, dev); -#ifdef CONFIG_RPMSG_UART_RAW_CONSOLE if (dev->isconsole) { uart_register(UART_RPMSG_DEV_CONSOLE, dev); } -#endif return 0; }