summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared/console-termios-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/shared/console-termios-init.c')
-rw-r--r--c/src/lib/libbsp/shared/console-termios-init.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/c/src/lib/libbsp/shared/console-termios-init.c b/c/src/lib/libbsp/shared/console-termios-init.c
index 83d14d15fa..a01a75abf2 100644
--- a/c/src/lib/libbsp/shared/console-termios-init.c
+++ b/c/src/lib/libbsp/shared/console-termios-init.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -17,36 +17,7 @@
#include <rtems/console.h>
-RTEMS_INTERRUPT_LOCK_DEFINE( static, console_lock, "console" )
-
-static rtems_device_major_number console_major = UINT32_MAX;
-
-static rtems_device_minor_number console_minor;
-
-rtems_status_code console_device_install(
- const char *device_file,
- const rtems_termios_device_handler *handler,
- const rtems_termios_device_flow *flow,
- rtems_termios_device_context *context
-)
-{
- rtems_interrupt_lock_context lock_context;
- rtems_device_minor_number minor;
-
- rtems_interrupt_lock_acquire( &console_lock, &lock_context );
- minor = console_minor;
- ++console_minor;
- rtems_interrupt_lock_release( &console_lock, &lock_context );
-
- return rtems_termios_device_install(
- device_file,
- console_major,
- minor,
- handler,
- flow,
- context
- );
-}
+#include <unistd.h>
bool console_device_probe_default(rtems_termios_device_context *context)
{
@@ -72,8 +43,6 @@ rtems_device_driver console_initialize(
if ( ( *ctx->probe )( ctx->context ) ) {
sc = rtems_termios_device_install(
ctx->device_file,
- major,
- minor,
ctx->handler,
ctx->flow,
ctx->context
@@ -85,16 +54,12 @@ rtems_device_driver console_initialize(
if ( !console_device_done ) {
console_device_done = true;
- sc = rtems_io_register_name( CONSOLE_DEVICE_NAME, major, minor );
- if ( sc != RTEMS_SUCCESSFUL ) {
+ if ( link( ctx->device_file, CONSOLE_DEVICE_NAME ) != 0 ) {
bsp_fatal( BSP_FATAL_CONSOLE_INSTALL_1 );
}
}
}
}
- console_major = major;
- console_minor = minor;
-
return RTEMS_SUCCESSFUL;
}