From ae5546704d15fa87a111760d777e95321143c199 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 14 Nov 2019 11:20:41 +0100 Subject: bsp/riscv: Fix format and warnings Update #3785. --- bsps/riscv/riscv/console/console-config.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'bsps/riscv/riscv/console/console-config.c') 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 -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; -- cgit v1.2.3