[PATCH 4/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create

zhengbin zhengbin13 at huawei.com
Mon Nov 18 12:34:43 UTC 2019


Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c:138:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: zhengbin <zhengbin13 at huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
index 2ff7801..cf7e442 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
@@ -135,8 +135,5 @@ int sun4i_ddc_create(struct sun4i_hdmi *hdmi, struct clk *parent)
 	ddc->m_offset = hdmi->variant->ddc_clk_m_offset;

 	hdmi->ddc_clk = devm_clk_register(hdmi->dev, &ddc->hw);
-	if (IS_ERR(hdmi->ddc_clk))
-		return PTR_ERR(hdmi->ddc_clk);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->ddc_clk);
 }
--
2.7.4



More information about the dri-devel mailing list