lkml.org 
[lkml]   [2020]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/sun4i: use PTR_ERR_OR_ZERO macro.
Date
Replace the use of IS_ERR and PTR_ZERO macros by returning the
PTR_ERR_OR_ZERO macro.
Changes suggested by coccinelle.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
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(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 417ade3d2565..84c04d8192b3 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -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);

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
index 2ff780114106..7a59505d6907 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
@@ -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);
}
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
index b66fa27fe6ea..12a7b7b1c99c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
@@ -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)
diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe3abff..fd09eff21b25 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
@@ -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)
}
--
2.17.1
\
 
 \ /
  Last update: 2020-01-06 15:01    [W:0.034 / U:9.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site