From b1b45de3db7ccfb706b8e2e9613afefd6ac963c3 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 19 Apr 2020 22:54:05 +0800 Subject: [PATCH] Revert "nshlib: Move BOARDIOC_FINALINIT into nsh_initscript" This reverts commit ac5632fc504f4e66b61131047326e78c16210d5c. --- nshlib/nsh_altconsole.c | 6 ++++++ nshlib/nsh_consolemain.c | 6 ++++++ nshlib/nsh_script.c | 6 ------ nshlib/nsh_usbconsole.c | 6 ++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/nshlib/nsh_altconsole.c b/nshlib/nsh_altconsole.c index c0570c70f..b2c4a4c11 100644 --- a/nshlib/nsh_altconsole.c +++ b/nshlib/nsh_altconsole.c @@ -294,6 +294,12 @@ int nsh_consolemain(int argc, FAR char *argv[]) netinit_bringup(); #endif +#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT) + /* Perform architecture-specific final-initialization (if configured) */ + + boardctl(BOARDIOC_FINALINIT, 0); +#endif + /* First map stderr and stdout to alternative devices */ ret = nsh_clone_console(pstate); diff --git a/nshlib/nsh_consolemain.c b/nshlib/nsh_consolemain.c index 59b5d7eba..3c27581cf 100644 --- a/nshlib/nsh_consolemain.c +++ b/nshlib/nsh_consolemain.c @@ -104,6 +104,12 @@ int nsh_consolemain(int argc, FAR char *argv[]) netinit_bringup(); #endif +#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT) + /* Perform architecture-specific final-initialization (if configured) */ + + boardctl(BOARDIOC_FINALINIT, 0); +#endif + /* Execute the session */ ret = nsh_session(pstate, true); diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c index 35231a350..740e0daec 100644 --- a/nshlib/nsh_script.c +++ b/nshlib/nsh_script.c @@ -196,12 +196,6 @@ int nsh_initscript(FAR struct nsh_vtbl_s *vtbl) vtbl->np.np_flags = NSH_NP_SET_OPTIONS_INIT; #endif - -#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT) - /* Perform architecture-specific final-initialization (if configured) */ - - boardctl(BOARDIOC_FINALINIT, 0); -#endif } return ret; diff --git a/nshlib/nsh_usbconsole.c b/nshlib/nsh_usbconsole.c index b018773e1..700a10fa9 100644 --- a/nshlib/nsh_usbconsole.c +++ b/nshlib/nsh_usbconsole.c @@ -326,6 +326,12 @@ int nsh_consolemain(int argc, FAR char *argv[]) netinit_bringup(); #endif +#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT) + /* Perform architecture-specific final-initialization (if configured) */ + + boardctl(BOARDIOC_FINALINIT, 0); +#endif + /* Now loop, executing creating a session for each USB connection */ for (; ; )