diff --git a/env/env.c b/env/env.c index 42c7d8155e..37b4b54cb7 100644 --- a/env/env.c +++ b/env/env.c @@ -329,6 +329,8 @@ int env_init(void) for (prio = 0; (drv = env_driver_lookup(ENVOP_INIT, prio)); prio++) { if (!drv->init || !(ret = drv->init())) env_set_inited(drv->location); + if (ret == -ENOENT) + env_set_inited(drv->location); debug("%s: Environment %s init done (ret=%d)\n", __func__, drv->name, ret); diff --git a/env/sf.c b/env/sf.c index 2eb2de1a4e..91ed2860ed 100644 --- a/env/sf.c +++ b/env/sf.c @@ -393,10 +393,12 @@ static int env_sf_init(void) return env_sf_init_early(); #endif /* - * we must return with 0 if there is nothing done, - * else env_set_inited() get not called in env_init() + * return here -ENOENT, so env_init() + * can set the init bit and later if no + * other Environment storage is defined + * can set the default environment */ - return 0; + return -ENOENT; } U_BOOT_ENV_LOCATION(sf) = {