blob: d125ec1e31f2d80d8a5b3e288db94e988bec16ff [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peter Tysereabe6d92009-10-16 17:36:25 -05002/*
3 * Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Peter Tysereabe6d92009-10-16 17:36:25 -05005 */
6
Peter Tysereabe6d92009-10-16 17:36:25 -05007#include <command.h>
Tom Rinidec7ea02024-05-20 13:35:03 -06008#include <vsprintf.h>
Peter Tysereabe6d92009-10-16 17:36:25 -05009
Simon Glassed38aef2020-05-10 11:40:03 -060010static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
11 char *const argv[])
Peter Tysereabe6d92009-10-16 17:36:25 -050012{
Marek Vasutfd099322022-12-20 07:25:59 +010013 int r;
14
15 r = 0;
Peter Tysereabe6d92009-10-16 17:36:25 -050016 if (argc > 1)
Marek Vasutfd099322022-12-20 07:25:59 +010017 r = simple_strtoul(argv[1], NULL, 10);
Peter Tysereabe6d92009-10-16 17:36:25 -050018
Marek Vasutfd099322022-12-20 07:25:59 +010019 return -r - 2;
Peter Tysereabe6d92009-10-16 17:36:25 -050020}
21
22U_BOOT_CMD(
23 exit, 2, 1, do_exit,
24 "exit script",
25 ""
26);