summaryrefslogtreecommitdiffstats
path: root/bsps/riscv/riscv/console/console-config.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-14 11:20:41 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-14 11:48:33 +0100
commitae5546704d15fa87a111760d777e95321143c199 (patch)
tree92cc2e27fe574b1e41d9508a49e7a7324f6989de /bsps/riscv/riscv/console/console-config.c
parentbsp/riscv: Fix use of uninitialized integer (diff)
downloadrtems-ae5546704d15fa87a111760d777e95321143c199.tar.bz2
bsp/riscv: Fix format and warnings
Update #3785.
Diffstat (limited to 'bsps/riscv/riscv/console/console-config.c')
-rw-r--r--bsps/riscv/riscv/console/console-config.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/bsps/riscv/riscv/console/console-config.c b/bsps/riscv/riscv/console/console-config.c
index 0e8262422a..ec64df2305 100644
--- a/bsps/riscv/riscv/console/console-config.c
+++ b/bsps/riscv/riscv/console/console-config.c
@@ -30,7 +30,7 @@
#if RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0
#include <bsp/fe310-uart.h>
-fe310_uart_context driver_context;
+fe310_uart_context fe310_uart_instance;
#endif
#if RISCV_ENABLE_HTIF_SUPPORT != 0
@@ -217,12 +217,11 @@ static void riscv_console_probe(void)
#if RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0
if (RISCV_CONSOLE_IS_COMPATIBLE(compat, compat_len, "sifive,uart0")) {
- fe310_uart_context *ctx ;
+ fe310_uart_context *ctx;
- ctx=&driver_context;
- ctx->regs = (uintptr_t) riscv_fdt_get_address(fdt, node);
- if (ctx->regs == 0)
- {
+ ctx = &fe310_uart_instance;
+ ctx->regs = riscv_fdt_get_address(fdt, node);
+ if (ctx->regs == NULL) {
bsp_fatal(RISCV_FATAL_NO_NS16550_REG_IN_DEVICE_TREE);
}
@@ -268,7 +267,8 @@ rtems_status_code console_initialize(
#endif
#if RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0
- char path[] = "/dev/ttyS0";
+ fe310_uart_context *ctx;
+ char fe310_path[] = "/dev/ttyS0";
#endif
rtems_termios_initialize();
@@ -303,19 +303,17 @@ rtems_status_code console_initialize(
#endif
#if RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0
- fe310_uart_context * ctx = &driver_context;
-
+ ctx = &fe310_uart_instance;
rtems_termios_device_install(
- path,
+ fe310_path,
&fe310_uart_handler,
NULL,
&ctx->base
);
if (&ctx->base == riscv_console.context) {
- link(path, CONSOLE_DEVICE_NAME);
+ link(fe310_path, CONSOLE_DEVICE_NAME);
}
-
#endif
return RTEMS_SUCCESSFUL;