]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Remove all drivers before exit
authorSimon Glass <sjg@chromium.org>
Wed, 23 Jul 2014 12:55:02 +0000 (06:55 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 23 Jul 2014 13:07:24 +0000 (14:07 +0100)
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>
arch/sandbox/cpu/cpu.c

index 3f4005b5d70b2ae3055c149ccb0eb536129d11b3..1aa397c5e773d8403293786838df63c7b539fa94 100644 (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);
 }