msm: bam_dmux: Add error checking for debugfs nodes
Add error checking to prevent silent failures for
debugfs support.
Change-Id: I245935fa76e79fdb24313f9ba010209e56b74cd0
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
diff --git a/arch/arm/mach-msm/bam_dmux.c b/arch/arm/mach-msm/bam_dmux.c
index 10203b1..edc41b4 100644
--- a/arch/arm/mach-msm/bam_dmux.c
+++ b/arch/arm/mach-msm/bam_dmux.c
@@ -1241,9 +1241,25 @@
struct dentry *dent,
int (*fill)(char *buf, int max))
{
- debugfs_create_file(name, mode, dent, fill, &debug_ops);
+ struct dentry *file;
+
+ file = debugfs_create_file(name, mode, dent, fill, &debug_ops);
+ if (IS_ERR(file))
+ pr_err("%s: debugfs create failed %d\n", __func__,
+ (int)PTR_ERR(file));
}
+static void debug_create_multiple(const char *name, mode_t mode,
+ struct dentry *dent,
+ int (*fill)(char *buf, int max, loff_t *ppos))
+{
+ struct dentry *file;
+
+ file = debugfs_create_file(name, mode, dent, fill, &debug_ops_multiple);
+ if (IS_ERR(file))
+ pr_err("%s: debugfs create failed %d\n", __func__,
+ (int)PTR_ERR(file));
+}
#endif
static void notify_all(int event, unsigned long data)
@@ -1986,8 +2002,7 @@
debug_create("tbl", 0444, dent, debug_tbl);
debug_create("ul_pkt_cnt", 0444, dent, debug_ul_pkt_cnt);
debug_create("stats", 0444, dent, debug_stats);
- debugfs_create_file("log", 0444, dent, debug_log,
- &debug_ops_multiple);
+ debug_create_multiple("log", 0444, dent, debug_log);
}
#endif
ret = kfifo_alloc(&bam_dmux_state_log, PAGE_SIZE, GFP_KERNEL);