uboot-mtk-20230718-09eda825: call env_ubi_erase to erase ubi env

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2024-09-11 15:06:36 +08:00
committed by hanwckf
parent 15ac366e7d
commit 15fd81d31d
2 changed files with 3 additions and 3 deletions

View File

@@ -24,6 +24,7 @@
#else
#define UBI_VID_OFFSET QUOTE(CONFIG_ENV_UBI_VID_OFFSET)
#endif
int env_ubi_erase(void);
#endif /* CONFIG_ENV_IS_IN_UBI */
static struct mtd_info *get_mtd_part(const char *partname)
@@ -330,8 +331,7 @@ static int erase_env(void *priv, const struct data_part_entry *dpe,
if (ubi_part(CONFIG_ENV_UBI_PART, UBI_VID_OFFSET))
return -EIO;
ubi_remove_vol(CONFIG_ENV_UBI_VOLUME);
create_ubi_volume(CONFIG_ENV_UBI_VOLUME, CONFIG_ENV_SIZE, UBI_VID_OFFSET, false);
env_ubi_erase();
ubi_exit();
#else
struct mtd_info *mtd;

View File

@@ -203,7 +203,7 @@ static int env_ubi_load(void)
}
#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */
static int env_ubi_erase(void)
int env_ubi_erase(void)
{
ALLOC_CACHE_ALIGN_BUFFER(char, env_buf, CONFIG_ENV_SIZE);
int ret = 0;