aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/build.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/build.c')
-rw-r--r--drivers/mtd/ubi/build.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index fb59604854c9..a56133585e92 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -985,14 +985,10 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
985 if (!ubi->fm_buf) 985 if (!ubi->fm_buf)
986 goto out_free; 986 goto out_free;
987#endif 987#endif
988 err = ubi_debugging_init_dev(ubi);
989 if (err)
990 goto out_free;
991
992 err = ubi_attach(ubi, 0); 988 err = ubi_attach(ubi, 0);
993 if (err) { 989 if (err) {
994 ubi_err("failed to attach mtd%d, error %d", mtd->index, err); 990 ubi_err("failed to attach mtd%d, error %d", mtd->index, err);
995 goto out_debugging; 991 goto out_free;
996 } 992 }
997 993
998 if (ubi->autoresize_vol_id != -1) { 994 if (ubi->autoresize_vol_id != -1) {
@@ -1059,8 +1055,6 @@ out_detach:
1059 ubi_wl_close(ubi); 1055 ubi_wl_close(ubi);
1060 ubi_free_internal_volumes(ubi); 1056 ubi_free_internal_volumes(ubi);
1061 vfree(ubi->vtbl); 1057 vfree(ubi->vtbl);
1062out_debugging:
1063 ubi_debugging_exit_dev(ubi);
1064out_free: 1058out_free:
1065 vfree(ubi->peb_buf); 1059 vfree(ubi->peb_buf);
1066 vfree(ubi->fm_buf); 1060 vfree(ubi->fm_buf);
@@ -1138,7 +1132,6 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
1138 ubi_free_internal_volumes(ubi); 1132 ubi_free_internal_volumes(ubi);
1139 vfree(ubi->vtbl); 1133 vfree(ubi->vtbl);
1140 put_mtd_device(ubi->mtd); 1134 put_mtd_device(ubi->mtd);
1141 ubi_debugging_exit_dev(ubi);
1142 vfree(ubi->peb_buf); 1135 vfree(ubi->peb_buf);
1143 vfree(ubi->fm_buf); 1136 vfree(ubi->fm_buf);
1144 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num); 1137 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num);