소스 검색

msm: camera: cci: Correct the check and return code

Update the master status data type, as it expects the negative value
and do the operation accordingly. Also, correct the return code and
update the validation check.

CRs-Fixed: 2686717
Change-Id: I8ecae74de2995a08e532a7f0ef078d48d45a928e
Signed-off-by: Jigarkumar Zala <[email protected]>
Jigarkumar Zala 5 년 전
부모
커밋
a1f635192b

+ 5 - 3
drivers/cam_sensor_module/cam_cci/cam_cci_core.c

@@ -148,15 +148,17 @@ static int32_t cam_cci_write_i2c_queue(struct cci_device *cci_dev,
 {
 	int32_t rc = 0;
 	uint32_t reg_offset = master * 0x200 + queue * 0x100;
-	struct cam_hw_soc_info *soc_info =
-		&cci_dev->soc_info;
-	void __iomem *base = soc_info->reg_map[0].mem_base;
+	struct cam_hw_soc_info *soc_info = NULL;
+	void __iomem *base = NULL;
 
 	if (!cci_dev) {
 		CAM_ERR(CAM_CCI, "Failed");
 		return -EINVAL;
 	}
 
+	soc_info = &cci_dev->soc_info;
+	base = soc_info->reg_map[0].mem_base;
+
 	rc = cam_cci_validate_queue(cci_dev, 1, master, queue);
 	if (rc < 0) {
 		CAM_ERR(CAM_CCI, "Failed %d", rc);

+ 2 - 2
drivers/cam_sensor_module/cam_cci/cam_cci_dev.c

@@ -33,8 +33,8 @@ static long cam_cci_subdev_ioctl(struct v4l2_subdev *sd,
 	int32_t rc = 0;
 
 	if (arg == NULL) {
-		CAM_ERR(CAM_CCI, "Invalid Args");
-		return rc;
+		CAM_ERR(CAM_CCI, "Args is Null");
+		return -EINVAL;
 	}
 
 	switch (cmd) {

+ 1 - 1
drivers/cam_sensor_module/cam_cci/cam_cci_dev.h

@@ -124,7 +124,7 @@ struct cam_cci_i2c_queue_info {
 };
 
 struct cam_cci_master_info {
-	uint32_t status;
+	int32_t status;
 	atomic_t q_free[NUM_QUEUES];
 	uint8_t q_lock[NUM_QUEUES];
 	uint8_t reset_pending;