X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_fdos.c;h=8ea1140e7fe880d145218eaa20504152b7c0dd96;hb=983c72f479173bced296f7292b4a9fbef9d17688;hp=238abdde461762dc1acf6997143ddbf4b3e0e1a1;hpb=cdc51c294ad33879c4e57edf4c9d2155381b1d59;p=karo-tx-uboot.git diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c index 238abdde46..8ea1140e7f 100644 --- a/common/cmd_fdos.c +++ b/common/cmd_fdos.c @@ -1,6 +1,6 @@ /* * (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 @@ -40,8 +40,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 +71,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,21 +90,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 (getenv_yesno("autostart")) { - char *local_args[2]; - 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]); } /*-----------------------------------------------------------------------------