[PATCH] sandbox: use 'poweroff' command for exit

Antony Pavlov antonynpavlov at gmail.com
Mon Jan 22 02:01:31 PST 2018


The 'poweroff' command is more appropriate for exit
barebox than 'reset'.

Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 arch/sandbox/board/Makefile            |  2 +-
 arch/sandbox/board/poweroff.c          | 17 +++++++++++++++++
 arch/sandbox/board/restart.c           | 17 -----------------
 arch/sandbox/configs/sandbox_defconfig |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)
 create mode 100644 arch/sandbox/board/poweroff.c
 delete mode 100644 arch/sandbox/board/restart.c

diff --git a/arch/sandbox/board/Makefile b/arch/sandbox/board/Makefile
index 333638ced6..b6c271c858 100644
--- a/arch/sandbox/board/Makefile
+++ b/arch/sandbox/board/Makefile
@@ -4,6 +4,6 @@ obj-y += hostfile.o
 obj-y += console.o
 obj-y += devices.o
 obj-y += dtb.o
-obj-y += restart.o
+obj-y += poweroff.o
 
 extra-y += barebox.lds
diff --git a/arch/sandbox/board/poweroff.c b/arch/sandbox/board/poweroff.c
new file mode 100644
index 0000000000..6b5a6dff15
--- /dev/null
+++ b/arch/sandbox/board/poweroff.c
@@ -0,0 +1,17 @@
+#include <common.h>
+#include <init.h>
+#include <poweroff.h>
+#include <mach/linux.h>
+
+static void sandbox_poweroff(struct poweroff_handler *poweroff)
+{
+	linux_exit();
+}
+
+static int poweroff_register_feature(void)
+{
+	poweroff_handler_register_fn(sandbox_poweroff);
+
+	return 0;
+}
+coredevice_initcall(poweroff_register_feature);
diff --git a/arch/sandbox/board/restart.c b/arch/sandbox/board/restart.c
deleted file mode 100644
index 79bf79a556..0000000000
--- a/arch/sandbox/board/restart.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <common.h>
-#include <init.h>
-#include <restart.h>
-#include <mach/linux.h>
-
-static void sandbox_restart_cpu(struct restart_handler *restart)
-{
-	linux_exit();
-}
-
-static int restart_register_feature(void)
-{
-	restart_handler_register_fn(sandbox_restart_cpu);
-
-	return 0;
-}
-coredevice_initcall(restart_register_feature);
diff --git a/arch/sandbox/configs/sandbox_defconfig b/arch/sandbox/configs/sandbox_defconfig
index dbaff12bfb..12b2479435 100644
--- a/arch/sandbox/configs/sandbox_defconfig
+++ b/arch/sandbox/configs/sandbox_defconfig
@@ -13,7 +13,6 @@ CONFIG_CMD_IMD=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_BOOTM is not set
 CONFIG_CMD_GO=y
-CONFIG_CMD_RESET=y
 CONFIG_CMD_UIMAGE=y
 CONFIG_CMD_PARTITION=y
 CONFIG_CMD_EXPORT=y
@@ -53,6 +52,7 @@ CONFIG_CMD_CRC_CMP=y
 CONFIG_CMD_MM=y
 CONFIG_CMD_DETECT=y
 CONFIG_CMD_FLASH=y
+CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_2048=y
 CONFIG_CMD_OF_NODE=y
 CONFIG_CMD_OF_PROPERTY=y
-- 
2.15.1




More information about the barebox mailing list