mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
env: Use getenv_yesno() more generally
Move the getenv_yesno() to env_common.c and change most checks for 'y' or 'n' to use this helper. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
committed by
Tom Rini
parent
7afcf3a55b
commit
ec8a252cd4
32
net/net.c
32
net/net.c
@@ -214,26 +214,24 @@ static int NetTryCount;
|
||||
*/
|
||||
void net_auto_load(void)
|
||||
{
|
||||
#if defined(CONFIG_CMD_NFS)
|
||||
const char *s = getenv("autoload");
|
||||
|
||||
if (s != NULL) {
|
||||
if (*s == 'n') {
|
||||
/*
|
||||
* Just use BOOTP/RARP to configure system;
|
||||
* Do not use TFTP to load the bootfile.
|
||||
*/
|
||||
net_set_state(NETLOOP_SUCCESS);
|
||||
return;
|
||||
}
|
||||
#if defined(CONFIG_CMD_NFS)
|
||||
if (strcmp(s, "NFS") == 0) {
|
||||
/*
|
||||
* Use NFS to load the bootfile.
|
||||
*/
|
||||
NfsStart();
|
||||
return;
|
||||
}
|
||||
if (s != NULL && strcmp(s, "NFS") == 0) {
|
||||
/*
|
||||
* Use NFS to load the bootfile.
|
||||
*/
|
||||
NfsStart();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (getenv_yesno("autoload") == 0) {
|
||||
/*
|
||||
* Just use BOOTP/RARP to configure system;
|
||||
* Do not use TFTP to load the bootfile.
|
||||
*/
|
||||
net_set_state(NETLOOP_SUCCESS);
|
||||
return;
|
||||
}
|
||||
TftpStart(TFTPGET);
|
||||
}
|
||||
|
Reference in New Issue
Block a user