diff mbox

[04/11] UBI: Fastmap: Move fastmap specific code into ubi_scan_fastmap()

Message ID 1340982869-77042-5-git-send-email-richard@nod.at
State New, archived
Headers show

Commit Message

Richard Weinberger June 29, 2012, 3:14 p.m. UTC
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/attach.c  |    9 ---------
 drivers/mtd/ubi/fastmap.c |    4 ++++
 2 files changed, 4 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index e88521b..1b62d54 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1384,15 +1384,6 @@  int ubi_attach(struct ubi_device *ubi, int force_scan)
 	if (err)
 		goto out_ai;
 
-	/* TODO: Hmm why this code is not hidden in 'ubi_scan_fastmap()' ? */
-	if (ubi->fm) {
-		ubi->fm_pool.max_size = ubi->fm->max_pool_size;
-		ubi->fm_wl_pool.max_size = ubi->fm->max_wl_pool_size;
-
-		ubi_msg("fastmap pool size: %d", ubi->fm_pool.max_size);
-		ubi_msg("fastmap WL pool size: %d", ubi->fm_wl_pool.max_size);
-	}
-
 	err = ubi_wl_init(ubi, ai);
 	if (err)
 		goto out_vtbl;
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 2c7c350..9b4fd34 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -1096,6 +1096,10 @@  int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai)
 	}
 
 	ubi->fm = fm;
+	ubi->fm_pool.max_size = ubi->fm->max_pool_size;
+	ubi->fm_wl_pool.max_size = ubi->fm->max_wl_pool_size;
+	ubi_msg("fastmap pool size: %d", ubi->fm_pool.max_size);
+	ubi_msg("fastmap WL pool size: %d", ubi->fm_wl_pool.max_size);
 
 free_hdr:
 	ubi_free_vid_hdr(ubi, vh);