msm: vidc: fix error during debugfs init
When CONFIG_DEBUG_FS is disabled, the call to
debugfs_create_dir will result in an error.
Add a check of the config to avoid the error.
Change-Id: I7a79dbc5c4c5e1e3192a11d55ad9b7994788f30f
Signed-off-by: ziqic <quic_ziqic_01@quicinc.com>
diff --git a/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c b/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c
index 05bf2f5..db88db9 100644
--- a/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c
@@ -607,8 +607,10 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
list_add_tail(&core->list, &vidc_driver->cores);
mutex_unlock(&vidc_driver->lock);
+#ifdef CONFIG_DEBUG_FS
core->debugfs_root = msm_vidc_debugfs_init_core(
core, vidc_driver->debugfs_root);
+#endif
vidc_driver->sku_version = core->resources.sku_version;
@@ -791,10 +793,13 @@ static int __init msm_vidc_init(void)
INIT_LIST_HEAD(&vidc_driver->cores);
mutex_init(&vidc_driver->lock);
+
+#ifdef CONFIG_DEBUG_FS
vidc_driver->debugfs_root = msm_vidc_debugfs_init_drv();
if (!vidc_driver->debugfs_root)
dprintk(VIDC_ERR,
"Failed to create debugfs for msm_vidc\n");
+#endif
rc = platform_driver_register(&msm_vidc_driver);
if (rc) {
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c
index 18bd77f..4600950 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc.c
@@ -1839,8 +1839,10 @@ void *msm_vidc_open(int core_id, int session_type)
msm_comm_scale_clocks_and_bus(inst);
+#ifdef CONFIG_DEBUG_FS
inst->debugfs_root =
msm_vidc_debugfs_init_inst(inst, core->debugfs_root);
+#endif
return inst;
fail_init: