diff options
author | Tom Rini <trini@konsulko.com> | 2020-07-27 09:25:53 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-07-27 09:25:53 -0400 |
commit | 3773028fced4795d52f02b387496395ec387f3bb (patch) | |
tree | ab11a71616bc9d5534d4b633520819c1b9be8b9c /env/env.c | |
parent | ada61f1ee2a4eaa1b29d699b5ba940483171df8a (diff) | |
parent | 5d4f7b4e2a1a2df459172ec95cbcdd6373dd707a (diff) |
Merge branch '2020-07-27-misc-env-improvements'
- Assorted environment fixes.
- Enhance environment in MMC and controlled via OF_CONTROL
- Allow for environment in FAT to use the same device we boot from
rather than be hard-coded.
Diffstat (limited to 'env/env.c')
-rw-r--r-- | env/env.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/env/env.c b/env/env.c index dcc25c030b2..2e64346438e 100644 --- a/env/env.c +++ b/env/env.c @@ -103,7 +103,7 @@ static void env_set_inited(enum env_location location) * using the above enum value as the bit index. We need to * make sure that we're not overflowing it. */ - BUILD_BUG_ON(ARRAY_SIZE(env_locations) > BITS_PER_LONG); + BUILD_BUG_ON(ENVL_COUNT > BITS_PER_LONG); gd->env_has_init |= BIT(location); } @@ -240,13 +240,17 @@ int env_save(void) if (drv) { int ret; - if (!drv->save) + printf("Saving Environment to %s... ", drv->name); + if (!drv->save) { + printf("not possible\n"); return -ENODEV; + } - if (!env_has_inited(drv->location)) + if (!env_has_inited(drv->location)) { + printf("not initialized\n"); return -ENODEV; + } - printf("Saving Environment to %s... ", drv->name); ret = drv->save(); if (ret) printf("Failed (%d)\n", ret); |