aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-04-25 02:02:44 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-20 13:25:58 -0400
commita904e3f1deb21b986b7789a830fa8f132ff3d406 (patch)
tree6850b21416600cab1c28a9b531035e70a1132aca /drivers/mtd/ubi/debug.c
parentef7088e7f84ba550b276bc4a74f2732ee5618fb8 (diff)
UBI: always dump VID and EC headers in case of errors
UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. Always dump the VID and EC headers' contents in case of errors when it is helpful. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/debug.c')
-rw-r--r--drivers/mtd/ubi/debug.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index 30aa9c440834..dce463d3c586 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -56,13 +56,11 @@ out:
56 return; 56 return;
57} 57}
58 58
59#ifdef CONFIG_MTD_UBI_DEBUG
60
61/** 59/**
62 * ubi_dbg_dump_ec_hdr - dump an erase counter header. 60 * ubi_dump_ec_hdr - dump an erase counter header.
63 * @ec_hdr: the erase counter header to dump 61 * @ec_hdr: the erase counter header to dump
64 */ 62 */
65void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr) 63void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
66{ 64{
67 printk(KERN_DEBUG "Erase counter header dump:\n"); 65 printk(KERN_DEBUG "Erase counter header dump:\n");
68 printk(KERN_DEBUG "\tmagic %#08x\n", 66 printk(KERN_DEBUG "\tmagic %#08x\n",
@@ -84,10 +82,10 @@ void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
84} 82}
85 83
86/** 84/**
87 * ubi_dbg_dump_vid_hdr - dump a volume identifier header. 85 * ubi_dump_vid_hdr - dump a volume identifier header.
88 * @vid_hdr: the volume identifier header to dump 86 * @vid_hdr: the volume identifier header to dump
89 */ 87 */
90void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr) 88void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr)
91{ 89{
92 printk(KERN_DEBUG "Volume identifier header dump:\n"); 90 printk(KERN_DEBUG "Volume identifier header dump:\n");
93 printk(KERN_DEBUG "\tmagic %08x\n", be32_to_cpu(vid_hdr->magic)); 91 printk(KERN_DEBUG "\tmagic %08x\n", be32_to_cpu(vid_hdr->magic));
@@ -108,6 +106,8 @@ void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr)
108 vid_hdr, UBI_VID_HDR_SIZE, 1); 106 vid_hdr, UBI_VID_HDR_SIZE, 1);
109} 107}
110 108
109#ifdef CONFIG_MTD_UBI_DEBUG
110
111/** 111/**
112 * ubi_dbg_dump_vol_info- dump volume information. 112 * ubi_dbg_dump_vol_info- dump volume information.
113 * @vol: UBI volume description object 113 * @vol: UBI volume description object