summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-23 06:55:02 -0600
committerSimon Glass <sjg@chromium.org>2014-07-23 14:07:24 +0100
commit6133683320ece056e49051e52a180adb21992b40 (patch)
tree7837fb070b4449446289b7a1a11494673f848f8c /arch/sandbox/cpu
parent9adbd7a116d62349eb0a85b5a08ab3ff0a12d556 (diff)
downloadu-boot-imx-6133683320ece056e49051e52a180adb21992b40.zip
u-boot-imx-6133683320ece056e49051e52a180adb21992b40.tar.gz
u-boot-imx-6133683320ece056e49051e52a180adb21992b40.tar.bz2
sandbox: Remove all drivers before exit
Drivers are supposed to be able to close down cleanly. To set a good example, make sandbox shut down its driver model drivers and remove them before exit. It may be desirable to do the same more generally once driver model is more widely-used. This could be done during bootm, before U-Boot jumps to the OS. It seems far too early to make this change. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu')
-rw-r--r--arch/sandbox/cpu/cpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 3f4005b..1aa397c 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <dm/root.h>
#include <os.h>
#include <asm/state.h>
@@ -14,6 +15,9 @@ void reset_cpu(ulong ignored)
if (state_uninit())
os_exit(2);
+ if (dm_uninit())
+ os_exit(2);
+
/* This is considered normal termination for now */
os_exit(0);
}