summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-10-20 11:16:12 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-10-20 11:31:02 +0200
commit9c96ea780ff0a85ad4916958d74e51ae6f26183f (patch)
treeddf7807ed6bd936fb49fbf233bc7e25cb0f96782 /c/src/lib/libbsp
parentrbheap: Fix rtems_rbheap_free() (diff)
downloadrtems-9c96ea780ff0a85ad4916958d74e51ae6f26183f.tar.bz2
bsp/leon3: Fix Termios context usage
Only the context of the console device was used and this is wrong in case more than one APBUART device is available.
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/console/console.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c
index ad6e32c4aa..4713491b81 100644
--- a/c/src/lib/libbsp/sparc/leon3/console/console.c
+++ b/c/src/lib/libbsp/sparc/leon3/console/console.c
@@ -44,14 +44,9 @@ int syscon_uart_index __attribute__((weak)) = 0;
static struct apbuart_context apbuarts[BSP_NUMBER_OF_TERMIOS_PORTS];
static int uarts = 0;
-static rtems_termios_device_context *leon3_console_get_context(int minor)
+static rtems_termios_device_context *leon3_console_get_context(int index)
{
- struct apbuart_context *uart;
-
- if (minor == 0)
- uart = &apbuarts[syscon_uart_index];
- else
- uart = &apbuarts[minor - 1];
+ struct apbuart_context *uart = &apbuarts[index];
rtems_termios_device_context_initialize(&uart->base, "APBUART");
@@ -159,7 +154,7 @@ rtems_device_driver console_initialize(
minor,
handler,
NULL,
- leon3_console_get_context(syscon_uart_index)
+ leon3_console_get_context(i)
);
}