aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorTanya Brokhman <tlinder@codeaurora.org>2014-10-20 12:57:00 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-11-07 05:08:51 -0500
commit326087033108e7806e24974f2c8271f95cddaf3a (patch)
tree3da326fd5be824e035f2ffcbddb896892e070039 /drivers/mtd/ubi/ubi.h
parent789c89935cef776ab5e8b8c5120d9c29a88ab40e (diff)
UBI: Extend UBI layer debug/messaging capabilities
If there is more then one UBI device mounted, there is no way to distinguish between messages from different UBI devices. Add device number to all ubi layer message types. The R/O block driver messages were replaced by pr_* since ubi_device structure is not used by it. Amended a bit by Artem. Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 320fc38fa2a1..f80ffaba9058 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -50,13 +50,14 @@
50#define UBI_NAME_STR "ubi" 50#define UBI_NAME_STR "ubi"
51 51
52/* Normal UBI messages */ 52/* Normal UBI messages */
53#define ubi_msg(fmt, ...) pr_notice("UBI: " fmt "\n", ##__VA_ARGS__) 53#define ubi_msg(ubi, fmt, ...) pr_notice("UBI-%d: %s:" fmt "\n", \
54 ubi->ubi_num, __func__, ##__VA_ARGS__)
54/* UBI warning messages */ 55/* UBI warning messages */
55#define ubi_warn(fmt, ...) pr_warn("UBI warning: %s: " fmt "\n", \ 56#define ubi_warn(ubi, fmt, ...) pr_warn("UBI-%d warning: %s: " fmt "\n", \
56 __func__, ##__VA_ARGS__) 57 ubi->ubi_num, __func__, ##__VA_ARGS__)
57/* UBI error messages */ 58/* UBI error messages */
58#define ubi_err(fmt, ...) pr_err("UBI error: %s: " fmt "\n", \ 59#define ubi_err(ubi, fmt, ...) pr_err("UBI-%d error: %s: " fmt "\n", \
59 __func__, ##__VA_ARGS__) 60 ubi->ubi_num, __func__, ##__VA_ARGS__)
60 61
61/* Background thread name pattern */ 62/* Background thread name pattern */
62#define UBI_BGT_NAME_PATTERN "ubi_bgt%dd" 63#define UBI_BGT_NAME_PATTERN "ubi_bgt%dd"
@@ -987,7 +988,7 @@ static inline void ubi_ro_mode(struct ubi_device *ubi)
987{ 988{
988 if (!ubi->ro_mode) { 989 if (!ubi->ro_mode) {
989 ubi->ro_mode = 1; 990 ubi->ro_mode = 1;
990 ubi_warn("switch to read-only mode"); 991 ubi_warn(ubi, "switch to read-only mode");
991 dump_stack(); 992 dump_stack();
992 } 993 }
993} 994}