Skip to content

Commit 9b2586b

Browse files
MarekPietaanangl
authored andcommitted
[nrf fromlist] usb: cdc_acm: Update log level only if UART log backend is enabled
Change updates log level only if UART log backend is enabled in Kconfig configuration. The log level update is not needed in case logs are provided over other backend (e.g. RTT). Change affects both USB stacks. Upstream PR: zephyrproject-rtos/zephyr#74520 Signed-off-by: Marek Pieta <[email protected]>
1 parent 3611f46 commit 9b2586b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

subsys/usb/device/class/cdc_acm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
#include <zephyr/logging/log.h>
5959
#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart) \
60+
&& defined(CONFIG_LOG_BACKEND_UART) \
6061
&& defined(CONFIG_USB_CDC_ACM_LOG_LEVEL) \
6162
&& CONFIG_USB_CDC_ACM_LOG_LEVEL != LOG_LEVEL_NONE
6263
/* Prevent endless recursive logging loop and warn user about it */

subsys/usb/device_next/class/usbd_cdc_acm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <zephyr/logging/log.h>
2424
#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart) \
25+
&& defined(CONFIG_LOG_BACKEND_UART) \
2526
&& defined(CONFIG_USBD_CDC_ACM_LOG_LEVEL) \
2627
&& CONFIG_USBD_CDC_ACM_LOG_LEVEL != LOG_LEVEL_NONE
2728
/* Prevent endless recursive logging loop and warn user about it */

0 commit comments

Comments
 (0)