Loading drivers/media/platform/msm/camera/cam_sensor_module/cam_sensor_io/cam_sensor_qup_i2c.c +14 −3 Original line number Diff line number Diff line Loading @@ -245,9 +245,15 @@ static int32_t cam_qup_i2c_write(struct camera_io_master *client, enum camera_sensor_i2c_type data_type) { int32_t rc = 0; unsigned char buf[I2C_REG_MAX_BUF_SIZE]; unsigned char *buf = NULL; uint8_t len = 0; buf = kzalloc(I2C_REG_MAX_BUF_SIZE, GFP_KERNEL | GFP_DMA); if (!buf) { CAM_ERR(CAM_SENSOR, "Buffer memory allocation failed"); return -ENOMEM; } CAM_DBG(CAM_SENSOR, "reg addr = 0x%x data type: %d", reg_setting->reg_addr, data_type); if (addr_type == CAMERA_SENSOR_I2C_TYPE_BYTE) { Loading @@ -273,7 +279,8 @@ static int32_t cam_qup_i2c_write(struct camera_io_master *client, len = 4; } else { CAM_ERR(CAM_SENSOR, "Invalid I2C addr type"); return -EINVAL; rc = -EINVAL; goto deallocate_buffer; } CAM_DBG(CAM_SENSOR, "Data: 0x%x", reg_setting->reg_data); Loading Loading @@ -307,12 +314,16 @@ static int32_t cam_qup_i2c_write(struct camera_io_master *client, len += 4; } else { CAM_ERR(CAM_SENSOR, "Invalid Data Type"); return -EINVAL; rc = -EINVAL; goto deallocate_buffer; } rc = cam_qup_i2c_txdata(client, buf, len); if (rc < 0) CAM_ERR(CAM_SENSOR, "failed rc: %d", rc); deallocate_buffer: kfree(buf); return rc; } Loading Loading
drivers/media/platform/msm/camera/cam_sensor_module/cam_sensor_io/cam_sensor_qup_i2c.c +14 −3 Original line number Diff line number Diff line Loading @@ -245,9 +245,15 @@ static int32_t cam_qup_i2c_write(struct camera_io_master *client, enum camera_sensor_i2c_type data_type) { int32_t rc = 0; unsigned char buf[I2C_REG_MAX_BUF_SIZE]; unsigned char *buf = NULL; uint8_t len = 0; buf = kzalloc(I2C_REG_MAX_BUF_SIZE, GFP_KERNEL | GFP_DMA); if (!buf) { CAM_ERR(CAM_SENSOR, "Buffer memory allocation failed"); return -ENOMEM; } CAM_DBG(CAM_SENSOR, "reg addr = 0x%x data type: %d", reg_setting->reg_addr, data_type); if (addr_type == CAMERA_SENSOR_I2C_TYPE_BYTE) { Loading @@ -273,7 +279,8 @@ static int32_t cam_qup_i2c_write(struct camera_io_master *client, len = 4; } else { CAM_ERR(CAM_SENSOR, "Invalid I2C addr type"); return -EINVAL; rc = -EINVAL; goto deallocate_buffer; } CAM_DBG(CAM_SENSOR, "Data: 0x%x", reg_setting->reg_data); Loading Loading @@ -307,12 +314,16 @@ static int32_t cam_qup_i2c_write(struct camera_io_master *client, len += 4; } else { CAM_ERR(CAM_SENSOR, "Invalid Data Type"); return -EINVAL; rc = -EINVAL; goto deallocate_buffer; } rc = cam_qup_i2c_txdata(client, buf, len); if (rc < 0) CAM_ERR(CAM_SENSOR, "failed rc: %d", rc); deallocate_buffer: kfree(buf); return rc; } Loading