diff --git a/uboot-mtk-20230718-09eda825/board/mediatek/common/mtd_helper.c b/uboot-mtk-20230718-09eda825/board/mediatek/common/mtd_helper.c index 6db2abb4ca7..265c9d5bbfc 100644 --- a/uboot-mtk-20230718-09eda825/board/mediatek/common/mtd_helper.c +++ b/uboot-mtk-20230718-09eda825/board/mediatek/common/mtd_helper.c @@ -561,7 +561,7 @@ static int mount_ubi(struct mtd_info *mtd, bool create) if (ret) return ret; - ubi_exit(); + ubi_detach(); ret = ubi_part(mtd->name, NULL); } @@ -657,7 +657,7 @@ static int write_ubi_fit_image(const void *data, size_t size, if (!ubi_find_volume(PART_FIT_NAME) && !ubi_find_volume(PART_FIP_NAME)) { /* ubi is dirty, erase ubi and recreate volumes */ - ubi_exit(); + ubi_detach(); ret = mtd_erase_skip_bad(mtd, 0, mtd->size, mtd->size, NULL, NULL, false); if (ret) return ret; diff --git a/uboot-mtk-20230718-09eda825/cmd/ubi.c b/uboot-mtk-20230718-09eda825/cmd/ubi.c index 2abf5636ade..b6428d8d719 100644 --- a/uboot-mtk-20230718-09eda825/cmd/ubi.c +++ b/uboot-mtk-20230718-09eda825/cmd/ubi.c @@ -552,7 +552,7 @@ static int ubi_set_skip_check(char *volume, bool skip_check) return ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); } -static int ubi_detach(void) +int ubi_detach(void) { #ifdef CONFIG_CMD_UBIFS /* diff --git a/uboot-mtk-20230718-09eda825/include/ubi_uboot.h b/uboot-mtk-20230718-09eda825/include/ubi_uboot.h index 58295a22d7a..1443566c9fe 100644 --- a/uboot-mtk-20230718-09eda825/include/ubi_uboot.h +++ b/uboot-mtk-20230718-09eda825/include/ubi_uboot.h @@ -59,5 +59,6 @@ extern int ubi_remove_vol(char *volume); extern struct ubi_device *ubi_devices[]; int cmd_ubifs_mount(char *vol_name); int cmd_ubifs_umount(void); +int ubi_detach(void); #endif