In case ENV_IS_IN_SPI_FLASH is disabled, returning ENVL_SPI_FLASH
leads to failure to find environment driver on start up. Fix this
by testing whether ENV_IS_IN_SPI_FLASH is enabled and if not, then
return ENVL_NOWHERE instead.
Signed-off-by: Marek Vasut <marex@denx.de>
enum env_location env_get_location(enum env_operation op, int prio)
{
- return prio ? ENVL_UNKNOWN : ENVL_SPI_FLASH;
+ return prio ? ENVL_UNKNOWN : CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH,
+ (ENVL_SPI_FLASH),
+ (ENVL_NOWHERE));
}