From 0ac7d722ede8e64973f68dbcd07b9521ba04cb63 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:47:00 -0600 Subject: 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 Signed-off-by: Simon Glass --- env/sf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'env/sf.c') diff --git a/env/sf.c b/env/sf.c index 4f92ae0568e..5531293e056 100644 --- a/env/sf.c +++ b/env/sf.c @@ -10,6 +10,7 @@ */ #include #include +#include #include #include #include @@ -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; } -- cgit v1.2.3