[PATCH 04/11] UBI: Fastmap: Move fastmap specific code into ubi_scan_fastmap()
Richard Weinberger
richard at nod.at
Fri Jun 29 11:14:22 EDT 2012
Signed-off-by: Richard Weinberger <richard at nod.at>
---
drivers/mtd/ubi/attach.c | 9 ---------
drivers/mtd/ubi/fastmap.c | 4 ++++
2 files changed, 4 insertions(+), 9 deletions(-)
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);
--
1.7.6.5
More information about the linux-mtd
mailing list