From b77fca2cb0b85b57b758e574b8db627faf967055 Mon Sep 17 00:00:00 2001 From: Jigarkumar Zala Date: Mon, 14 Jun 2021 10:56:24 -0700 Subject: [PATCH] msm: camera: csiphy: Continue in case of unavailibility of CSIPHY hw During the common control register programming across csiphy hws, there can be chance that number of CSIPHY hw supported is differnt than max csiphy hw supported among various targets. This change make sure to continue to next available hardware index in case of unavailibility of csiphy hw soc index. CRs-Fixed: 2948896 Change-Id: I1572974226701dcd3aadeb3d9cf95924e05520a9 Signed-off-by: Jigarkumar Zala --- drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c index 4781285ea46d..210179307a9e 100644 --- a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c +++ b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c @@ -153,6 +153,12 @@ static void cam_csiphy_prgm_cmn_data( csiphybase = g_phy_data[csiphy_idx].base_address; is_3phase = g_phy_data[csiphy_idx].is_3phase; + if (!csiphybase) { + CAM_DBG(CAM_CSIPHY, "CSIPHY: %d is not available in platform", + csiphy_idx); + continue; + } + for (i = 0; i < size; i++) { csiphy_common_reg = &csiphy_dev->ctrl_reg->csiphy_common_reg[i];