aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-14 11:11:29 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-16 07:50:16 -0400
commit6edb9793959fb547a15d5ffe6b142d9f0b3e41a6 (patch)
tree85ce150c27b728dbddcfbd303154c7e59c95e548 /drivers/mtd
parent332873d60b943c9bf53957c6e334038ac5e9dc6b (diff)
UBI: kill debugging buffer
This patch kills the 'ubi->dbg_peb_buf' debugging buffer and the associated mutex, because all users of this buffer are now gone. We are killing this buffer because we are going to switch to dynamic debugging control, just like in UBIFS, which means that CONFIG_MTD_UBI_DEBUG_PARANOID will be removed. In this case we'd end up always allocating 'ubi->dbg_peb_buf', which is rather large (128KiB or more), and this would be wasteful. Thus, we are just killing it. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/build.c13
-rw-r--r--drivers/mtd/ubi/ubi.h6
2 files changed, 0 insertions, 19 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index ec0ad19c691a..3a047199a105 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -939,13 +939,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
939 if (!ubi->peb_buf2) 939 if (!ubi->peb_buf2)
940 goto out_free; 940 goto out_free;
941 941
942#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
943 mutex_init(&ubi->dbg_buf_mutex);
944 ubi->dbg_peb_buf = vmalloc(ubi->peb_size);
945 if (!ubi->dbg_peb_buf)
946 goto out_free;
947#endif
948
949 err = attach_by_scanning(ubi); 942 err = attach_by_scanning(ubi);
950 if (err) { 943 if (err) {
951 dbg_err("failed to attach by scanning, error %d", err); 944 dbg_err("failed to attach by scanning, error %d", err);
@@ -1011,9 +1004,6 @@ out_detach:
1011out_free: 1004out_free:
1012 vfree(ubi->peb_buf1); 1005 vfree(ubi->peb_buf1);
1013 vfree(ubi->peb_buf2); 1006 vfree(ubi->peb_buf2);
1014#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
1015 vfree(ubi->dbg_peb_buf);
1016#endif
1017 if (ref) 1007 if (ref)
1018 put_device(&ubi->dev); 1008 put_device(&ubi->dev);
1019 else 1009 else
@@ -1084,9 +1074,6 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
1084 put_mtd_device(ubi->mtd); 1074 put_mtd_device(ubi->mtd);
1085 vfree(ubi->peb_buf1); 1075 vfree(ubi->peb_buf1);
1086 vfree(ubi->peb_buf2); 1076 vfree(ubi->peb_buf2);
1087#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
1088 vfree(ubi->dbg_peb_buf);
1089#endif
1090 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num); 1077 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num);
1091 put_device(&ubi->dev); 1078 put_device(&ubi->dev);
1092 return 0; 1079 return 0;
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 9af362c2a137..49c864d175db 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -388,8 +388,6 @@ struct ubi_wl_entry;
388 * @peb_buf2: another buffer of PEB size used for different purposes 388 * @peb_buf2: another buffer of PEB size used for different purposes
389 * @buf_mutex: protects @peb_buf1 and @peb_buf2 389 * @buf_mutex: protects @peb_buf1 and @peb_buf2
390 * @ckvol_mutex: serializes static volume checking when opening 390 * @ckvol_mutex: serializes static volume checking when opening
391 * @dbg_peb_buf: buffer of PEB size used for debugging
392 * @dbg_buf_mutex: protects @dbg_peb_buf
393 */ 391 */
394struct ubi_device { 392struct ubi_device {
395 struct cdev cdev; 393 struct cdev cdev;
@@ -471,10 +469,6 @@ struct ubi_device {
471 void *peb_buf2; 469 void *peb_buf2;
472 struct mutex buf_mutex; 470 struct mutex buf_mutex;
473 struct mutex ckvol_mutex; 471 struct mutex ckvol_mutex;
474#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
475 void *dbg_peb_buf;
476 struct mutex dbg_buf_mutex;
477#endif
478}; 472};
479 473
480extern struct kmem_cache *ubi_wl_entry_slab; 474extern struct kmem_cache *ubi_wl_entry_slab;