disp: msm: dsi: modify handling of debugfs initialization

Add support to allow creation of debugfs node only if
CONFIG_DEBUG_FS is enabled.

Change-Id: I1ae2c4188a99e3ed88f59fc021efc01407bf942d
Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
Harigovindan P
2020-03-18 17:35:55 +05:30
committed by Satya Rama Aditya Pinapala
parent a1143d12be
commit 1b9802c099
2 changed files with 46 additions and 18 deletions

View File

@@ -83,6 +83,7 @@ static const struct of_device_id msm_dsi_of_match[] = {
{}
};
#ifdef CONFIG_DEBUG_FS
static ssize_t debugfs_state_info_read(struct file *file,
char __user *buff,
size_t count,
@@ -209,6 +210,11 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
struct dentry *dir, *state_file, *reg_dump;
char dbg_name[DSI_DEBUG_NAME_LEN];
if (!dsi_ctrl || !parent) {
DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
return -EINVAL;
}
dir = debugfs_create_dir(dsi_ctrl->name, parent);
if (IS_ERR_OR_NULL(dir)) {
rc = PTR_ERR(dir);
@@ -256,6 +262,17 @@ static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
debugfs_remove(dsi_ctrl->debugfs_root);
return 0;
}
#else
static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
struct dentry *parent)
{
return 0;
}
static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
{
return 0;
}
#endif /* CONFIG_DEBUG_FS */
static inline struct msm_gem_address_space*
dsi_ctrl_get_aspace(struct dsi_ctrl *dsi_ctrl,
@@ -2043,7 +2060,7 @@ int dsi_ctrl_drv_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent)
{
int rc = 0;
if (!dsi_ctrl || !parent) {
if (!dsi_ctrl) {
DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
return -EINVAL;
}