浏览代码

msm: camera: cci: Correct the condition check

Submodules per master uninitialize check needs to be set to false
when all submodules are released for that master. Correct the
refcount check for the appropriate operation.

CRs-Fixed: 2686487
Change-Id: Iaea94e4d1ad83bef99d40cec4e96de3993783ec1
Signed-off-by: Jigarkumar Zala <[email protected]>
Jigarkumar Zala 5 年之前
父节点
当前提交
c8ac83dc3e
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      drivers/cam_sensor_module/cam_cci/cam_cci_soc.c

+ 6 - 2
drivers/cam_sensor_module/cam_cci/cam_cci_soc.c

@@ -403,11 +403,15 @@ int cam_cci_soc_release(struct cci_device *cci_dev,
 		return -EINVAL;
 	}
 
-	if (--cci_dev->master_active_slave[master])
+	if (!(--cci_dev->master_active_slave[master])) {
 		cci_dev->cci_master_info[master].is_initilized = false;
+		CAM_DBG(CAM_CCI,
+			"All submodules are released for master: %d", master);
+	}
 
 	if (--cci_dev->ref_count) {
-		CAM_DBG(CAM_CCI, "ref_count Exit %d", cci_dev->ref_count);
+		CAM_DBG(CAM_CCI, "Submodule release: Ref_count: %d",
+			cci_dev->ref_count);
 		return 0;
 	}