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

Commit a61a4061 authored by Depeng Shao's avatar Depeng Shao Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: sensor: Validate sensor name during probe



Some cameras have same sensor id in one device,
but camera sensor driver just validate sensor
id now which may result in wrong probe when camera
daemon is killed and camera re-probe sensor again.

Also validate the sensor name if sensor has probed.

Change-Id: I641bf8c346bada9e6cc619389077e25e666c743f
Signed-off-by: default avatarDepeng Shao <dshao@codeaurora.org>
parent 818d9d53
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, 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
@@ -776,9 +776,12 @@ int32_t msm_sensor_driver_probe(void *setting,
		 */
		if (slave_info->sensor_id_info.sensor_id ==
			s_ctrl->sensordata->cam_slave_info->
				sensor_id_info.sensor_id) {
			pr_err("slot%d: sensor id%d already probed\n",
				sensor_id_info.sensor_id &&
			!(strcmp(slave_info->sensor_name,
			s_ctrl->sensordata->cam_slave_info->sensor_name))) {
			pr_err("slot%d: sensor name: %s sensor id%d already probed\n",
				slave_info->camera_id,
				slave_info->sensor_name,
				s_ctrl->sensordata->cam_slave_info->
					sensor_id_info.sensor_id);
			msm_sensor_fill_sensor_info(s_ctrl,