diff options
author | Simon Glass <sjg@chromium.org> | 2019-08-01 09:47:00 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-08-11 16:43:41 -0400 |
commit | 0ac7d722ede8e64973f68dbcd07b9521ba04cb63 (patch) | |
tree | 179942d65436fafe8d1c3193bd15913f3b2c5f18 /env/sf.c | |
parent | 1f3db0c135fcaf40ff88bdcd058b56bc7e1f58f3 (diff) |
env: Move get/set_default_env() to env.h
Move these functions to the new header file and rename set_default_env()
to env_set_default() so that it has a consistent env_ prefix.
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'env/sf.c')
-rw-r--r-- | env/sf.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -10,6 +10,7 @@ */ #include <common.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <malloc.h> #include <spi.h> @@ -48,7 +49,7 @@ static int setup_flash_device(void) CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE, &new); if (ret) { - set_default_env("spi_flash_probe_bus_cs() failed", 0); + env_set_default("spi_flash_probe_bus_cs() failed", 0); return ret; } @@ -60,7 +61,7 @@ static int setup_flash_device(void) CONFIG_ENV_SPI_CS, CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); if (!env_flash) { - set_default_env("spi_flash_probe() failed", 0); + env_set_default("spi_flash_probe() failed", 0); return -EIO; } } @@ -161,7 +162,7 @@ static int env_sf_load(void) tmp_env2 = (env_t *)memalign(ARCH_DMA_MINALIGN, CONFIG_ENV_SIZE); if (!tmp_env1 || !tmp_env2) { - set_default_env("malloc() failed", 0); + env_set_default("malloc() failed", 0); ret = -EIO; goto out; } @@ -256,7 +257,7 @@ static int env_sf_load(void) buf = (char *)memalign(ARCH_DMA_MINALIGN, CONFIG_ENV_SIZE); if (!buf) { - set_default_env("malloc() failed", 0); + env_set_default("malloc() failed", 0); return -EIO; } @@ -267,7 +268,7 @@ static int env_sf_load(void) ret = spi_flash_read(env_flash, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, buf); if (ret) { - set_default_env("spi_flash_read() failed", 0); + env_set_default("spi_flash_read() failed", 0); goto err_read; } |