浏览代码

msm: camera: isp: Use correct resource count to release resource

SFE resource count isn't fixed, it is less than the max
supported resource, we need to use actual resource count
to release the resource.

CRs-Fixed: 3234791
Change-Id: I7cb16f3d8120451cac1bfc226f6849268f3b5c46
Signed-off-by: Depeng Shao <[email protected]>
Depeng Shao 3 年之前
父节点
当前提交
f0879f2506

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_rd.c

@@ -2137,7 +2137,8 @@ int cam_sfe_bus_rd_deinit(
 			CAM_ERR(CAM_SFE,
 				"Deinit RM failed rc=%d", rc);
 	}
-	for (i = 0; i < CAM_SFE_BUS_RD_MAX; i++) {
+
+	for (i = 0; i < bus_priv->num_bus_rd_resc; i++) {
 		rc = cam_sfe_bus_deinit_sfe_bus_rd_resource(
 			&bus_priv->sfe_bus_rd[i]);
 		if (rc < 0)

+ 2 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_wr.c

@@ -3640,7 +3640,7 @@ int cam_sfe_bus_wr_deinit(
 	bus_priv->common_data.err_irq_subscribe = false;
 	spin_unlock_irqrestore(&bus_priv->common_data.spin_lock, flags);
 
-	for (i = 0; i < CAM_SFE_BUS_WR_COMP_GRP_MAX; i++) {
+	for (i = 0; i < bus_priv->num_comp_grp; i++) {
 		rc = cam_sfe_bus_deinit_comp_grp(&bus_priv->comp_grp[i]);
 		if (rc < 0)
 			CAM_ERR(CAM_SFE,
@@ -3648,7 +3648,7 @@ int cam_sfe_bus_wr_deinit(
 				bus_priv->common_data.core_index, i, rc);
 	}
 
-	for (i = 0; i < CAM_SFE_BUS_SFE_OUT_MAX; i++) {
+	for (i = 0; i < bus_priv->num_out; i++) {
 		rc = cam_sfe_bus_deinit_sfe_out_resource(
 			&bus_priv->sfe_out[i]);
 		if (rc < 0)