diff options
| -rw-r--r-- | drivers/media/platform/msm/ais/common/cam_soc_api.c | 7 | ||||
| -rw-r--r-- | drivers/media/platform/msm/ais/sensor/cci/msm_early_cam.c | 28 |
2 files changed, 33 insertions, 2 deletions
diff --git a/drivers/media/platform/msm/ais/common/cam_soc_api.c b/drivers/media/platform/msm/ais/common/cam_soc_api.c index 0ab803da54fc..6c0e188adb75 100644 --- a/drivers/media/platform/msm/ais/common/cam_soc_api.c +++ b/drivers/media/platform/msm/ais/common/cam_soc_api.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, 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 @@ -58,18 +58,21 @@ static int msm_camera_get_clk_info_internal(struct device *dev, cnt = of_property_count_strings(of_node, "clock-names"); if (cnt <= 0) { pr_err("err: No clocks found in DT=%zu\n", cnt); + *clk_info = NULL; return -EINVAL; } tmp = of_property_count_u32_elems(of_node, "qcom,clock-rates"); if (tmp <= 0) { pr_err("err: No clk rates device tree, count=%zu", tmp); + *clk_info = NULL; return -EINVAL; } if (cnt != tmp) { pr_err("err: clk name/rates mismatch, strings=%zu, rates=%zu\n", cnt, tmp); + *clk_info = NULL; return -EINVAL; } @@ -79,11 +82,13 @@ static int msm_camera_get_clk_info_internal(struct device *dev, if (tmp <= 0) { pr_err("err: control strings not found in DT count=%zu", tmp); + *clk_info = NULL; return -EINVAL; } if (cnt != tmp) { pr_err("err: controls mismatch, strings=%zu, ctl=%zu\n", cnt, tmp); + *clk_info = NULL; return -EINVAL; } clock_cntl_support = true; diff --git a/drivers/media/platform/msm/ais/sensor/cci/msm_early_cam.c b/drivers/media/platform/msm/ais/sensor/cci/msm_early_cam.c index 7329dd9ddb27..9a06531f7b04 100644 --- a/drivers/media/platform/msm/ais/sensor/cci/msm_early_cam.c +++ b/drivers/media/platform/msm/ais/sensor/cci/msm_early_cam.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -164,6 +164,19 @@ int msm_ais_enable_clocks(void) return rc; } + if ((new_early_cam_dev->pdev == NULL) || + (new_early_cam_dev->early_cam_clk_info == NULL) || + (new_early_cam_dev->early_cam_clk == NULL) || + (new_early_cam_dev->num_clk == 0)) { + rc = -EINVAL; + pr_err("%s: Clock details uninitialised %d %pK %pK %pK %zd\n", + __func__, rc, new_early_cam_dev->pdev, + new_early_cam_dev->early_cam_clk_info, + new_early_cam_dev->early_cam_clk, + new_early_cam_dev->num_clk); + return rc; + } + rc = msm_camera_clk_enable(&new_early_cam_dev->pdev->dev, new_early_cam_dev->early_cam_clk_info, new_early_cam_dev->early_cam_clk, @@ -366,6 +379,19 @@ static int msm_early_cam_probe(struct platform_device *pdev) pr_err("%s:%d early_cam enable_vreg failed\n", __func__, __LINE__); + if ((new_early_cam_dev->pdev == NULL) || + (new_early_cam_dev->early_cam_clk_info == NULL) || + (new_early_cam_dev->early_cam_clk == NULL) || + (new_early_cam_dev->num_clk == 0)) { + rc = -EINVAL; + pr_err("%s: Clock details uninitialised %d %pK %pK %pK %zd\n", + __func__, rc, new_early_cam_dev->pdev, + new_early_cam_dev->early_cam_clk_info, + new_early_cam_dev->early_cam_clk, + new_early_cam_dev->num_clk); + return rc; + } + rc = msm_camera_clk_enable(&new_early_cam_dev->pdev->dev, new_early_cam_dev->early_cam_clk_info, new_early_cam_dev->early_cam_clk, |
