Commit e020ac96 authored by Zhen Lei's avatar Zhen Lei Committed by Rob Clark

drm/msm/dpu: Fix error return code in dpu_mdss_init()

The error code returned by platform_get_irq() is stored in 'irq', it's
forgotten to be copied to 'ret' before being returned. As a result, the
value 0 of 'ret' is returned incorrectly.

After the above fix is completed, initializing the local variable 'ret'
to 0 is no longer needed, remove it.

In addition, when dpu_mdss_init() is successfully returned, the value of
'ret' is always 0. Therefore, replace "return ret" with "return 0" to make
the code clearer.

Fixes: 070e64dc ("drm/msm/dpu: Convert to a chained irq chip")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210510063805.3262-2-thunder.leizhen@huawei.comReviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent a1c9b1e3
...@@ -225,7 +225,7 @@ int dpu_mdss_init(struct drm_device *dev) ...@@ -225,7 +225,7 @@ int dpu_mdss_init(struct drm_device *dev)
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
struct dpu_mdss *dpu_mdss; struct dpu_mdss *dpu_mdss;
struct dss_module_power *mp; struct dss_module_power *mp;
int ret = 0; int ret;
int irq; int irq;
dpu_mdss = devm_kzalloc(dev->dev, sizeof(*dpu_mdss), GFP_KERNEL); dpu_mdss = devm_kzalloc(dev->dev, sizeof(*dpu_mdss), GFP_KERNEL);
...@@ -253,8 +253,10 @@ int dpu_mdss_init(struct drm_device *dev) ...@@ -253,8 +253,10 @@ int dpu_mdss_init(struct drm_device *dev)
goto irq_domain_error; goto irq_domain_error;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) if (irq < 0) {
ret = irq;
goto irq_error; goto irq_error;
}
irq_set_chained_handler_and_data(irq, dpu_mdss_irq, irq_set_chained_handler_and_data(irq, dpu_mdss_irq,
dpu_mdss); dpu_mdss);
...@@ -263,7 +265,7 @@ int dpu_mdss_init(struct drm_device *dev) ...@@ -263,7 +265,7 @@ int dpu_mdss_init(struct drm_device *dev)
pm_runtime_enable(dev->dev); pm_runtime_enable(dev->dev);
return ret; return 0;
irq_error: irq_error:
_dpu_mdss_irq_domain_fini(dpu_mdss); _dpu_mdss_irq_domain_fini(dpu_mdss);
......
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