浏览代码

disp: msm: dp: skip creating dir when debugfs is disabled

When CONFIG_DEBUG_FS is disabled skip creating root directory.

Change-Id: I97bed925392b781b73687164ca55e6cb09f951fc
Signed-off-by: Rajat Gupta <[email protected]>
Rajat Gupta 5 年之前
父节点
当前提交
05a35f8446
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      msm/dp/dp_debug.c

+ 6 - 0
msm/dp/dp_debug.c

@@ -2269,6 +2269,12 @@ static int dp_debug_init(struct dp_debug *dp_debug)
 		struct dp_debug_private, dp_debug);
 		struct dp_debug_private, dp_debug);
 	struct dentry *dir;
 	struct dentry *dir;
 
 
+	if (!IS_ENABLED(CONFIG_DEBUG_FS)) {
+		DP_WARN("Not creating debug root dir.");
+		debug->root = NULL;
+		return 0;
+	}
+
 	dir = debugfs_create_dir(DEBUG_NAME, NULL);
 	dir = debugfs_create_dir(DEBUG_NAME, NULL);
 	if (IS_ERR_OR_NULL(dir)) {
 	if (IS_ERR_OR_NULL(dir)) {
 		if (!dir)
 		if (!dir)