Commit 740828c7 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dpu: fix error handling in dpu_rm_init

Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If
the value is NULL, then the function will return 0 instead of a proper
return code. Moreover none of dpu_hw_*_init() functions can return NULL.
So, replace all dpu_rm_init()'s IS_ERR_OR_NULL() calls with IS_ERR().
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/20220121210618.3482550-6-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent ae57fdf0
...@@ -109,7 +109,7 @@ int dpu_rm_init(struct dpu_rm *rm, ...@@ -109,7 +109,7 @@ int dpu_rm_init(struct dpu_rm *rm,
continue; continue;
} }
hw = dpu_hw_lm_init(lm->id, mmio, cat); hw = dpu_hw_lm_init(lm->id, mmio, cat);
if (IS_ERR_OR_NULL(hw)) { if (IS_ERR(hw)) {
rc = PTR_ERR(hw); rc = PTR_ERR(hw);
DPU_ERROR("failed lm object creation: err %d\n", rc); DPU_ERROR("failed lm object creation: err %d\n", rc);
goto fail; goto fail;
...@@ -126,7 +126,7 @@ int dpu_rm_init(struct dpu_rm *rm, ...@@ -126,7 +126,7 @@ int dpu_rm_init(struct dpu_rm *rm,
continue; continue;
} }
hw = dpu_hw_merge_3d_init(merge_3d->id, mmio, cat); hw = dpu_hw_merge_3d_init(merge_3d->id, mmio, cat);
if (IS_ERR_OR_NULL(hw)) { if (IS_ERR(hw)) {
rc = PTR_ERR(hw); rc = PTR_ERR(hw);
DPU_ERROR("failed merge_3d object creation: err %d\n", DPU_ERROR("failed merge_3d object creation: err %d\n",
rc); rc);
...@@ -144,7 +144,7 @@ int dpu_rm_init(struct dpu_rm *rm, ...@@ -144,7 +144,7 @@ int dpu_rm_init(struct dpu_rm *rm,
continue; continue;
} }
hw = dpu_hw_pingpong_init(pp->id, mmio, cat); hw = dpu_hw_pingpong_init(pp->id, mmio, cat);
if (IS_ERR_OR_NULL(hw)) { if (IS_ERR(hw)) {
rc = PTR_ERR(hw); rc = PTR_ERR(hw);
DPU_ERROR("failed pingpong object creation: err %d\n", DPU_ERROR("failed pingpong object creation: err %d\n",
rc); rc);
...@@ -168,7 +168,7 @@ int dpu_rm_init(struct dpu_rm *rm, ...@@ -168,7 +168,7 @@ int dpu_rm_init(struct dpu_rm *rm,
continue; continue;
} }
hw = dpu_hw_intf_init(intf->id, mmio, cat); hw = dpu_hw_intf_init(intf->id, mmio, cat);
if (IS_ERR_OR_NULL(hw)) { if (IS_ERR(hw)) {
rc = PTR_ERR(hw); rc = PTR_ERR(hw);
DPU_ERROR("failed intf object creation: err %d\n", rc); DPU_ERROR("failed intf object creation: err %d\n", rc);
goto fail; goto fail;
...@@ -185,7 +185,7 @@ int dpu_rm_init(struct dpu_rm *rm, ...@@ -185,7 +185,7 @@ int dpu_rm_init(struct dpu_rm *rm,
continue; continue;
} }
hw = dpu_hw_ctl_init(ctl->id, mmio, cat); hw = dpu_hw_ctl_init(ctl->id, mmio, cat);
if (IS_ERR_OR_NULL(hw)) { if (IS_ERR(hw)) {
rc = PTR_ERR(hw); rc = PTR_ERR(hw);
DPU_ERROR("failed ctl object creation: err %d\n", rc); DPU_ERROR("failed ctl object creation: err %d\n", rc);
goto fail; goto fail;
...@@ -202,7 +202,7 @@ int dpu_rm_init(struct dpu_rm *rm, ...@@ -202,7 +202,7 @@ int dpu_rm_init(struct dpu_rm *rm,
continue; continue;
} }
hw = dpu_hw_dspp_init(dspp->id, mmio, cat); hw = dpu_hw_dspp_init(dspp->id, mmio, cat);
if (IS_ERR_OR_NULL(hw)) { if (IS_ERR(hw)) {
rc = PTR_ERR(hw); rc = PTR_ERR(hw);
DPU_ERROR("failed dspp object creation: err %d\n", rc); DPU_ERROR("failed dspp object creation: err %d\n", rc);
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment