diff options
| author | Vijay kumar Tumati <vtumati@codeaurora.org> | 2017-09-22 15:41:42 +0530 |
|---|---|---|
| committer | Vijay kumar Tumati <vtumati@codeaurora.org> | 2017-10-04 14:13:13 +0530 |
| commit | 2b32c1afd4ccf088d1d07edd4924d806adbde46e (patch) | |
| tree | d69564f1ed77741adb1f964d6ef8f4de4fb671c9 | |
| parent | 0d617edc010f86e7df529fe2b30b1b12ffdcee58 (diff) | |
msm: camera: Check if regulator is null before enabling
Using IS_ERR_OR_NULL instead of IS_ERR to also check for
null pointer.
Change-Id: If53a07db52a4d091693a49f9d084df7d4fbf257a
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c b/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c index f6d7f5fb8d32..8a49c7cf9f4a 100644 --- a/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c +++ b/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c @@ -424,7 +424,7 @@ int msm_camera_config_vreg(struct device *dev, struct camera_vreg_t *cam_vreg, curr_vreg = &cam_vreg[j]; reg_ptr[j] = regulator_get(dev, curr_vreg->reg_name); - if (IS_ERR(reg_ptr[j])) { + if (IS_ERR_OR_NULL(reg_ptr[j])) { pr_err("%s: %s get failed\n", __func__, curr_vreg->reg_name); @@ -531,7 +531,7 @@ int msm_camera_enable_vreg(struct device *dev, struct camera_vreg_t *cam_vreg, continue; } else j = i; - if (IS_ERR(reg_ptr[j])) { + if (IS_ERR_OR_NULL(reg_ptr[j])) { pr_err("%s: %s null regulator\n", __func__, cam_vreg[j].reg_name); goto disable_vreg; |
