Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73b686c7 authored by Ravi Kishore Tanuku's avatar Ravi Kishore Tanuku Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Avoid unwanted variable overwrite in i2c probe



Change the initialization sequence to avoid overwriting the
variables with default values in eeprom i2c probe sequence.

Change-Id: I50b6e8164f556012f949d7be82dc450e156930cd
Signed-off-by: default avatarRavi Kishore Tanuku <rktanuku@codeaurora.org>
parent 83ad0691
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -69,6 +69,9 @@ int32_t cam_eeprom_update_i2c_info(struct cam_eeprom_ctrl_t *e_ctrl,
		cci_client->retries = 3;
		cci_client->id_map = 0;
		cci_client->i2c_freq_mode = i2c_info->i2c_freq_mode;
	} else if (e_ctrl->io_master_info.master_type == I2C_MASTER) {
		e_ctrl->io_master_info.client->addr = i2c_info->slave_addr;
		CAM_DBG(CAM_EEPROM, "Slave addr: 0x%x", i2c_info->slave_addr);
	}
	return 0;
}
@@ -188,6 +191,9 @@ static int cam_eeprom_i2c_driver_probe(struct i2c_client *client,
	e_ctrl->io_master_info.master_type = I2C_MASTER;
	e_ctrl->io_master_info.client = client;
	e_ctrl->eeprom_device_type = MSM_CAMERA_I2C_DEVICE;
	e_ctrl->cal_data.mapdata = NULL;
	e_ctrl->cal_data.map = NULL;
	e_ctrl->userspace_probe = false;

	rc = cam_eeprom_parse_dt(e_ctrl);
	if (rc) {
@@ -205,10 +211,6 @@ static int cam_eeprom_i2c_driver_probe(struct i2c_client *client,
	if (rc)
		goto free_soc;

	e_ctrl->cal_data.mapdata = NULL;
	e_ctrl->cal_data.map = NULL;
	e_ctrl->userspace_probe = false;

	if (soc_private->i2c_info.slave_addr != 0)
		e_ctrl->io_master_info.client->addr =
			soc_private->i2c_info.slave_addr;