In function dpu_core_irq_enable & dpu_core_irq_disable, when some index enable or disable failed, return value will be covered by next success index. Upper call function will not catch this error, this maybe does not meet the expectation. This change is to make the code a bit more readable. Signed-off-by: Bernard Zhao <bernard@xxxxxxxx> --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c index f1bc6a1af7a7..e6da0469b743 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c @@ -123,8 +123,8 @@ int dpu_core_irq_enable(struct dpu_kms *dpu_kms, int *irq_idxs, u32 irq_count) DRM_ERROR("irq_idx=%d enable_count=%d\n", irq_idxs[0], counts); for (i = 0; (i < irq_count) && !ret; i++) - ret = _dpu_core_irq_enable(dpu_kms, irq_idxs[i]); - + if (_dpu_core_irq_enable(dpu_kms, irq_idxs[i]) != 0) + ret = -EINVAL; return ret; } @@ -178,8 +178,8 @@ int dpu_core_irq_disable(struct dpu_kms *dpu_kms, int *irq_idxs, u32 irq_count) DRM_ERROR("irq_idx=%d enable_count=%d\n", irq_idxs[0], counts); for (i = 0; (i < irq_count) && !ret; i++) - ret = _dpu_core_irq_disable(dpu_kms, irq_idxs[i]); - + if (_dpu_core_irq_disable(dpu_kms, irq_idxs[i]) != 0) + ret = -EINVAL; return ret; } -- 2.28.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel