drm/sun4i: use PTR_ERR_OR_ZERO macro.
Subsystems (5)
PATCH 1/1 drm/sun4i: use PTR_ERR_OR_ZERO macro.
Replace the use of IS_ERR and PTR_ZERO macros by returning the PTR_ERR_OR_ZERO macro.
Changes suggested by coccinelle.
--- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 4 +--- drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 4 +--- drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 4 +--- drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/sun4i/sun4i_dotclock.c +1 -3
@@ -191,10 +191,8 @@ 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);
drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c +1 -3
@@ -135,8 +135,6 @@ 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); }
drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c +1 -3
@@ -278,10 +278,8 @@ static int sun4i_hdmi_init_regmap_fields(struct sun4i_hdmi *hdmi) hdmi->field_ddc_sck_en =devm_regmap_field_alloc (hdmi->dev, hdmi->regmap, hdmi->variant->field_ddc_sck_en); -if (IS_ERR (hdmi->field_ddc_sck_en)) -return PTR_ERR (hdmi->field_ddc_sck_en); -return 0 ; +return PTR_ERR_OR_ZERO (hdmi->field_ddc_sck_en); }int sun4i_hdmi_i2c_create (struct device *dev,struct sun4i_hdmi *hdmi)
drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c +1 -3
@@ -171,8 +171,6 @@ int sun8i_phy_clk_create(struct sun8i_hdmi_phy *phy, struct device *dev, priv->hw.init = &init; phy->clk_phy =devm_clk_register (dev, &priv->hw); -if (IS_ERR (phy->clk_phy)) -return PTR_ERR (phy->clk_phy); -return 0 ; + return PTR_ERR_OR_ZERO(phy->clk_phy) }
Signature · 1 line
2.17.1
Maxime Ripard
maintainerHi,
Quoted 5 lines · Wambui Karuga
Replace the use of
IS_ERRandPTR_ZEROmacros by returning thePTR_ERR_OR_ZEROmacro.
Changes suggested by coccinelle.Signed-off-by Wambui Karuga <[email protected]>
Unfortunately, that patch came up a number of time and shouldn't have been a coccinelle script in the first place.
I've sent a patch to remove that script:
https://lore.kernel.org/lkml/[email protected]/
Maxime
Quoted 7 lines · Maxime Ripard
Hi,
Quoted 4 lines · Wambui Karuga
Replace the use of
IS_ERRandPTR_ZEROmacros by returning thePTR_ERR_OR_ZEROmacro.
Changes suggested by coccinelle.
Quoted 8 lines
Quoted 1 line
Signed-off-by Wambui Karuga <[email protected]>Unfortunately, that patch came up a number of time and shouldn't have been a coccinelle script in the first place.
I've sent a patch to remove that script:
https://lore.kernel.org/lkml/[email protected]/
Okay, thanks for the review.
Quoted 2 lines
Maxime