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

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


Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:232: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_tmds_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
index fbf7da9..c90dd0a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
@@ -229,8 +229,5 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi)
 	tmds->div_offset = hdmi->variant->tmds_clk_div_offset;

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



More information about the dri-devel mailing list