diff options
Diffstat (limited to 'cpukit/sapi/src/ioregisterdriver.c')
-rw-r--r-- | cpukit/sapi/src/ioregisterdriver.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cpukit/sapi/src/ioregisterdriver.c b/cpukit/sapi/src/ioregisterdriver.c index 65cc56f513..ca1ecb93ae 100644 --- a/cpukit/sapi/src/ioregisterdriver.c +++ b/cpukit/sapi/src/ioregisterdriver.c @@ -25,6 +25,8 @@ #include <rtems/rtems/intr.h> #include <rtems/score/threaddispatch.h> +extern int _IO_Manager_drivers_inititalized; + static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) @@ -108,5 +110,15 @@ rtems_status_code rtems_io_register_driver( _Thread_Enable_dispatch(); - return rtems_io_initialize( major, 0, NULL ); + if ( _IO_Manager_drivers_inititalized ) { + /* Other drivers have already been initialized, we initialize + * the driver directly. + */ + return rtems_io_initialize( major, 0, NULL ); + } else { + /* The driver will be initialized together with all other drivers + * in a later stage by _IO_Initialize_all_drivers(). + */ + return RTEMS_SUCCESSFUL; + } } |