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>
This commit is contained in:
Simon Glass 2014-07-23 06:55:02 -06:00
parent 9adbd7a116
commit 6133683320
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}