mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00: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:
parent
7afcf3a55b
commit
ec8a252cd4
16 changed files with 56 additions and 79 deletions
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue