@@ -178,10 +178,7 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon *tcon)
dclk->hw.init = &init;
tcon->dclk = clk_register(dev, &dclk->hw);
- if (IS_ERR(tcon->dclk))
- return PTR_ERR(tcon->dclk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(tcon->dclk);
}
EXPORT_SYMBOL(sun4i_dclk_create);
@@ -120,8 +120,5 @@ int sun4i_ddc_create(struct sun4i_hdmi *hdmi, struct clk *parent)
ddc->hw.init = &init;
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);
}
@@ -218,8 +218,5 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi)
tmds->hw.init = &init;
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);
}
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> --- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 5 +---- drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 5 +---- drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-)