diff mbox

[-next] drm/msm/hdmi: use PTR_ERR_OR_ZERO() to simplify the code

Message ID 1468321612-16384-1-git-send-email-weiyj_lk@163.com (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

weiyj_lk@163.com July 12, 2016, 11:06 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)





--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Rob Clark July 12, 2016, 12:36 p.m. UTC | #1
thanks, I'll pick this up for my 4.8 pull req

BR,
-R

On Tue, Jul 12, 2016 at 7:06 AM,  <weiyj_lk@163.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.
>
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 33bf52c..9737207 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -537,10 +537,7 @@ static int msm_hdmi_register_audio_driver(struct hdmi *hdmi, struct device *dev)
>                                                          PLATFORM_DEVID_AUTO,
>                                                          &codec_data,
>                                                          sizeof(codec_data));
> -       if (IS_ERR(hdmi->audio_pdev))
> -               return PTR_ERR(hdmi->audio_pdev);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(hdmi->audio_pdev);
>  }
>
>  static int msm_hdmi_bind(struct device *dev, struct device *master, void *data)
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 33bf52c..9737207 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -537,10 +537,7 @@  static int msm_hdmi_register_audio_driver(struct hdmi *hdmi, struct device *dev)
 							 PLATFORM_DEVID_AUTO,
 							 &codec_data,
 							 sizeof(codec_data));
-	if (IS_ERR(hdmi->audio_pdev))
-		return PTR_ERR(hdmi->audio_pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->audio_pdev);
 }
 
 static int msm_hdmi_bind(struct device *dev, struct device *master, void *data)