summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-08-04 01:17:31 +0200
committerTom Rini <[email protected]>2026-08-10 14:22:08 -0600
commitc882fc0fe40e184e75035909aea2f3109cbe78bb (patch)
tree9f1775af9e504d2e0f9eb74a8540c0dee7a4fcd7
parent3cafdbb9cb6a3bdf250d17f5f875ba7712aa278f (diff)
mtd: cfi: Replace env_get_f() with env_get_yesno()
Simplify the code, replace env_get_f() with env_get_yesno(). The env_get_yesno() internally calls env_get() which may fall back to env_get_f() if the environment access is not initialized yet. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
-rw-r--r--drivers/mtd/cfi_flash.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index e50502824ac..cf52abf1554 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2407,13 +2407,6 @@ unsigned long flash_init(void)
unsigned long size = 0;
int i;
-#ifdef CONFIG_SYS_FLASH_PROTECTION
- /* read environment from EEPROM */
- char s[64];
-
- env_get_f("unlock", s, sizeof(s));
-#endif
-
#ifdef CONFIG_CFI_FLASH /* for driver model */
cfi_flash_init_dm();
#endif
@@ -2438,7 +2431,7 @@ unsigned long flash_init(void)
#endif /* CONFIG_SYS_FLASH_QUIET_TEST */
}
#ifdef CONFIG_SYS_FLASH_PROTECTION
- else if (strcmp(s, "yes") == 0) {
+ else if (env_get_yesno("unlock")) {
/*
* Only the U-Boot image and it's environment
* is protected, all other sectors are