From 2049aa8d16a891cbb2684d28599a0639734e4307 Mon Sep 17 00:00:00 2001 From: Yong Cong Sin Date: Tue, 14 Nov 2023 14:21:35 +0800 Subject: [PATCH] logging: backend: uart: variable shouldn't have the same name as struct Rename the `device` variable in the `struct lbu_cb_ctx` to `uart_dev`, as it is a convention in Zephyr to not have the struct variable name after the struct. Signed-off-by: Yong Cong Sin --- subsys/logging/backends/log_backend_uart.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsys/logging/backends/log_backend_uart.c b/subsys/logging/backends/log_backend_uart.c index fbfdcc365a6..869ba869e75 100644 --- a/subsys/logging/backends/log_backend_uart.c +++ b/subsys/logging/backends/log_backend_uart.c @@ -28,7 +28,7 @@ struct lbu_data { struct lbu_cb_ctx { const struct log_output *output; - const struct device *device; + const struct device *uart_dev; struct lbu_data *data; }; @@ -78,7 +78,7 @@ static int char_out(uint8_t *data, size_t length, void *ctx) int err; const struct lbu_cb_ctx *cb_ctx = ctx; struct lbu_data *lb_data = cb_ctx->data; - const struct device *uart_dev = cb_ctx->device; + const struct device *uart_dev = cb_ctx->uart_dev; if (pm_device_runtime_is_enabled(uart_dev) && !k_is_in_isr()) { if (pm_device_runtime_get(uart_dev) < 0) { @@ -142,7 +142,7 @@ static int format_set(const struct log_backend *const backend, uint32_t log_type static void log_backend_uart_init(struct log_backend const *const backend) { const struct lbu_cb_ctx *ctx = backend->cb->ctx; - const struct device *uart_dev = ctx->device; + const struct device *uart_dev = ctx->uart_dev; struct lbu_data *data = ctx->data; __ASSERT_NO_MSG(device_is_ready(uart_dev)); @@ -180,7 +180,7 @@ static void panic(struct log_backend const *const backend) { const struct lbu_cb_ctx *ctx = backend->cb->ctx; struct lbu_data *data = ctx->data; - const struct device *uart_dev = ctx->device; + const struct device *uart_dev = ctx->uart_dev; /* Ensure that the UART device is in active mode */ #if defined(CONFIG_PM_DEVICE_RUNTIME) @@ -238,7 +238,7 @@ const struct log_backend_api log_backend_uart_api = { \ static const struct lbu_cb_ctx lbu_cb_ctx##__VA_ARGS__ = { \ .output = &lbu_output##__VA_ARGS__, \ - .device = DEVICE_DT_GET(node_id), \ + .uart_dev = DEVICE_DT_GET(node_id), \ .data = &lbu_data##__VA_ARGS__, \ }; \ \