summaryrefslogtreecommitdiff
path: root/env/env.c
Commit message (Collapse)AuthorAgeFilesLines
* env: Replace all open-coded gd->env_valid values with ENV_ flagsSimon Glass2017-08-201-1/+1
| | | | | Some of these were missed in the conversion. Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Allow env_load() to detect errorsSimon Glass2017-08-201-1/+1
| | | | | | | Now that we have errors available in the environment driver's load() method, check the return valid. Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Correct case of no sub-init functionTom Rini2017-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | With the change to the environment code to remove the common init stage of pointing to the default environment and setting it as valid, combined with the change to switch gd->env_valid from 0/1/2 to an enum we now must set env_valid to one of the enum values rather than an int. And in this case, not only was setting it to an int wrong, it was now the wrong value. Finally, in the case of ENV_IS_NOWHERE we must still say that our envionrment is invalid after init for things to continue to function. Fixes: 7938822a6b75 ("env: Drop common init() functions") Tested-by: Marek Vasut <marek.vasut@gmail.com> Reported-by: Marek Vasut <marek.vasut@gmail.com> Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> --- Changes in v3: - Actually include changes for env/nowhere.c
* env: Drop saveenv() in favour of env_save()Simon Glass2017-08-151-6/+0
| | | | | | | | | Use the env_save() function directly now that there is only one implementation of saveenv(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop env_relocate_spec() in favour of env_load()Simon Glass2017-08-151-5/+0
| | | | | | | | | This is a strange name for a function that loads the environment. There is now only one implementation of this function, so use the new env_load() function directly instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop env_get_char_spec()Simon Glass2017-08-151-6/+3
| | | | | | | | We only have a single implementation of this function now and it is called env_get_char(). Drop the old function and the weak version. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Drop env_init_new()Simon Glass2017-08-151-5/+1
| | | | | | | | Now that env_init() is only defined once we can drop the env_init_new() name and just use env_init(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop the env_name_spec globalSimon Glass2017-08-151-1/+1
| | | | | | | | Add a name to the driver and use that instead of the global variable declared by each driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop common init() functionsSimon Glass2017-08-151-5/+9
| | | | | | | | | Most of the init() implementations just use the default environment. Adjust env_init_new() to do this automatically, and drop the redundant code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Switch over to use environment location driversSimon Glass2017-08-151-0/+20
| | | | | | | | Move over to use a the master implementation of the location drivers, with each method calling out to the appropriate driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Add a new implementation of environment accessSimon Glass2017-08-151-0/+145
We plan to move to a environment access via drivers for each location where the environment can be stored. Add an implementation for this. So far it is not used, but will be pressed into service in a future patch. Signed-off-by: Simon Glass <sjg@chromium.org>