X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_fdos.c;h=69303255ff0e72ba4d6fac2d05eb1e2f7a4851db;hb=dd88ab325cfcc7f803afd40600571b3f9c79319c;hp=a8822d91b07c5c64dd5106de5eba136faa2c041b;hpb=ac956293befb265b8958654d08c4ad52e605d46e;p=u-boot diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c index a8822d91b0..69303255ff 100644 --- a/common/cmd_fdos.c +++ b/common/cmd_fdos.c @@ -1,25 +1,9 @@ /* * (C) Copyright 2002 - * Stäubli Faverges - + * Stäubli Faverges - * Pierre AUBERT p.aubert@staubli.com * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -40,8 +24,6 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *name; char *ep; int size; - int rcode = 0; - char buf [12]; int drive = CONFIG_SYS_FDC_DRIVE_NUMBER; /* pre-set load_addr */ @@ -73,7 +55,7 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) name = argv [2]; break; default: - return cmd_usage(cmdtp); + return CMD_RET_USAGE; } /* Init physical layer */ @@ -92,22 +74,12 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } flush_cache (load_addr, size); - sprintf(buf, "%x", size); - setenv("filesize", buf); + setenv_hex("filesize", size); printf("Floppy DOS load complete: %d bytes loaded to 0x%lx\n", size, load_addr); - /* Check if we should attempt an auto-start */ - if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) { - char *local_args[2]; - extern int do_bootm (cmd_tbl_t *, int, int, char *[]); - local_args[0] = argv[0]; - local_args[1] = NULL; - printf ("Automatic boot of image at addr 0x%08lX ...\n", load_addr); - rcode = do_bootm (cmdtp, 0, 1, local_args); - } - return rcode; + return bootm_maybe_autostart(cmdtp, argv[0]); } /*-----------------------------------------------------------------------------