Pārlūkot izejas kodu

msm: camera: common: Remove logically dead code

Removes logically dead code from various locations.

CRs-Fixed: 3325322
Change-Id: I2bfebbeb50cb6179bea8f02292027dab1d7f6e9b
Signed-off-by: Joshua Florez <[email protected]>
Joshua Florez 2 gadi atpakaļ
vecāks
revīzija
337721da5f

+ 1 - 4
drivers/cam_cust/cam_custom_hw_mgr/cam_custom_hw_mgr.c

@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -421,10 +422,6 @@ static int cam_custom_mgr_start_hw(void *hw_mgr_priv,
 
 start_only:
 
-	/* Start custom HW first */
-	if (rc < 0)
-		goto err;
-
 	/* Start custom csid */
 	list_for_each_entry(hw_mgr_res,
 		&ctx->res_list_custom_csid, list) {

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

@@ -2047,7 +2047,8 @@ int cam_sfe_bus_rd_init(
 		rc = cam_sfe_bus_init_rm_resource(i, bus_priv, bus_hw_info,
 			&bus_priv->bus_client[i]);
 		if (rc < 0) {
-			CAM_ERR(CAM_SFE, "Init RM failed rc=%d", rc);
+			CAM_ERR(CAM_SFE, "Init RM failed for client:%d, rc=%d",
+				i, rc);
 			goto deinit_rm;
 		}
 	}
@@ -2056,7 +2057,8 @@ int cam_sfe_bus_rd_init(
 		rc = cam_sfe_bus_init_sfe_bus_read_resource(i, bus_priv,
 			bus_rd_hw_info);
 		if (rc < 0) {
-			CAM_ERR(CAM_SFE, "Init SFE RD failed rc=%d", rc);
+			CAM_ERR(CAM_SFE, "Init SFE RD failed for client:%d, rc=%d",
+				i, rc);
 			goto deinit_sfe_bus_rd;
 		}
 	}
@@ -2085,8 +2087,6 @@ int cam_sfe_bus_rd_init(
 	return rc;
 
 deinit_sfe_bus_rd:
-	if (i < 0)
-		i = CAM_SFE_BUS_RD_MAX;
 	for (--i; i >= 0; i--)
 		cam_sfe_bus_deinit_sfe_bus_rd_resource(
 			&bus_priv->sfe_bus_rd[i]);

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

@@ -3593,8 +3593,6 @@ int cam_sfe_bus_wr_init(
 	return rc;
 
 deinit_sfe_out:
-	if (i < 0)
-		i = CAM_SFE_BUS_SFE_OUT_MAX;
 	for (--i; i >= 0; i--)
 		cam_sfe_bus_deinit_sfe_out_resource(&bus_priv->sfe_out[i]);
 

+ 5 - 4
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_rd_ver1.c

@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/ratelimit.h>
@@ -1272,7 +1273,8 @@ int cam_vfe_bus_rd_ver1_init(
 		rc = cam_vfe_bus_init_rm_resource(i, bus_priv, bus_hw_info,
 			&bus_priv->bus_client[i]);
 		if (rc < 0) {
-			CAM_ERR(CAM_ISP, "Init RM failed rc=%d", rc);
+			CAM_ERR(CAM_ISP, "Init RM failed for client:%d, rc=%d",
+				i, rc);
 			goto deinit_rm;
 		}
 	}
@@ -1281,7 +1283,8 @@ int cam_vfe_bus_rd_ver1_init(
 		rc = cam_vfe_bus_init_vfe_bus_read_resource(i, bus_priv,
 			bus_rd_hw_info);
 		if (rc < 0) {
-			CAM_ERR(CAM_ISP, "Init VFE Out failed rc=%d", rc);
+			CAM_ERR(CAM_ISP, "Init VFE Out failed for client:%d, rc=%d",
+				i, rc);
 			goto deinit_vfe_bus_rd;
 		}
 	}
@@ -1303,8 +1306,6 @@ int cam_vfe_bus_rd_ver1_init(
 	return rc;
 
 deinit_vfe_bus_rd:
-	if (i < 0)
-		i = CAM_VFE_BUS_RD_VER1_VFE_BUSRD_MAX;
 	for (--i; i >= 0; i--)
 		cam_vfe_bus_deinit_vfe_bus_rd_resource(
 			&bus_priv->vfe_bus_rd[i]);

+ 6 - 8
drivers/cam_req_mgr/cam_mem_mgr.c

@@ -701,14 +701,12 @@ static int cam_mem_util_get_dma_buf(size_t len,
 			cam_flags, tbl.force_cache_allocs);
 	} else {
 		use_cached_heap = false;
-		CAM_ERR(CAM_MEM,
-			"Using UNCACHED heap not supported, cam_flags=0x%x, force_cache_allocs=%d",
-			cam_flags, tbl.force_cache_allocs);
-		/*
-		 * Need a better handling based on whether dma-buf-heaps support
-		 * uncached heaps or not. For now, assume not supported.
-		 */
-		return -EINVAL;
+		if (!tbl.system_uncached_heap) {
+			CAM_ERR(CAM_MEM,
+				"Using UNCACHED heap not supported, cam_flags=0x%x, force_cache_allocs=%d",
+				cam_flags, tbl.force_cache_allocs);
+			return -EINVAL;
+		}
 	}
 
 	if (cam_flags & CAM_MEM_FLAG_PROTECTED_MODE) {

+ 0 - 4
drivers/cam_sensor_module/cam_flash/cam_flash_core.c

@@ -1501,10 +1501,6 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
 
 		cmd_buf = (uint32_t *)((uint8_t *)cmd_buf_ptr +
 			cmd_desc->offset);
-		if (!cmd_buf) {
-			rc = -EINVAL;
-			return rc;
-		}
 		cmn_hdr = (struct common_header *)cmd_buf;
 
 		switch (cmn_hdr->cmd_type) {

+ 2 - 1
drivers/cam_sensor_module/cam_sensor_io/cam_sensor_spi.c

@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include "cam_sensor_spi.h"
@@ -449,7 +450,7 @@ int cam_spi_write(struct camera_io_master *client,
 	if ((addr_type <= CAMERA_SENSOR_I2C_TYPE_INVALID)
 		|| (addr_type >= CAMERA_SENSOR_I2C_TYPE_MAX)
 		|| (data_type <= CAMERA_SENSOR_I2C_TYPE_INVALID)
-		|| (data_type != CAMERA_SENSOR_I2C_TYPE_MAX))
+		|| (data_type >= CAMERA_SENSOR_I2C_TYPE_MAX))
 		return rc;
 
 	CAM_DBG(CAM_EEPROM, "Data: 0x%x", data);