blob: 7bf241ec732d96b19e678ee1d13a8b9073d37522 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05002/*
3 * Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05005 */
6
7#include <common.h>
8#include <command.h>
9
Simon Glass09140112020-05-10 11:40:03 -060010static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
11 char *const argv[])
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050012{
13 int r;
14
15 r = 0;
16 if (argc > 1)
17 r = simple_strtoul(argv[1], NULL, 10);
18
19 return -r - 2;
20}
21
22U_BOOT_CMD(
23 exit, 2, 1, do_exit,
24 "exit script",
25 ""
26);