From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Eric_B=E9nard?= Date: Fri, 10 Jun 2011 23:53:41 +0200 Subject: [U-Boot] [PATCH v7 RESEND 4/5] Put common autoload code into auto_load() function In-Reply-To: <1307718251-15947-5-git-send-email-sjg@chromium.org> References: <1307718251-15947-1-git-send-email-sjg@chromium.org> <1307718251-15947-5-git-send-email-sjg@chromium.org> Message-ID: <4DF29265.10305@eukrea.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On 10/06/2011 17:04, Simon Glass wrote: > This is a small clean-up patch. > > Signed-off-by: Simon Glass > --- > net/bootp.c | 75 +++++++++++++++++++++++++--------------------------------- > 1 files changed, 32 insertions(+), 43 deletions(-) > > diff --git a/net/bootp.c b/net/bootp.c > index 4db63cb..4774624 100644 > --- a/net/bootp.c > +++ b/net/bootp.c > @@ -138,6 +138,35 @@ static int truncate_sz (const char *name, int maxlen, int curlen) > return (curlen); > } > > +/* > + * Check if autoload is enabled. If so, use either NFS or TFTP to download > + * the boot file. > + */ > +static void auto_load(void) > +{ > + const char *s = getenv("autoload"); > + > + if (s != NULL) { > + if (*s == 'n') { > + /* > + * Just use BOOTP to configure system; > + * Do not use TFTP to load the bootfile. > + */ > + NetState = NETLOOP_SUCCESS; > + return; > + } > +#if defined(CONFIG_CMD_NFS) > + if (strcmp(s, "NFS") == 0) { > + /* > + * Use NFS to load the bootfile. > + */ > + NfsStart(); > + return; > + } > +#endif > + TftpStart(); > +} a "}" is missing here Eric