All of lore.kernel.org
 help / color / mirror / Atom feed
From: weiyj_lk@163.com
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: [PATCH -next] [media] vcodec: mediatek: Fix return value check in mtk_vcodec_init_enc_pm()
Date: Tue, 12 Jul 2016 11:02:28 +0000	[thread overview]
Message-ID: <1468321348-16045-1-git-send-email-weiyj_lk@163.com> (raw)

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_clk_get() returns ERR_PTR()
and not returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index 2379e97..3e73e9d 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -67,27 +67,27 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 	pm->dev = &pdev->dev;
 
 	pm->vencpll_d2 = devm_clk_get(&pdev->dev, "venc_sel_src");
-	if (pm->vencpll_d2 == NULL) {
+	if (IS_ERR(pm->vencpll_d2)) {
 		mtk_v4l2_err("devm_clk_get vencpll_d2 fail");
-		ret = -1;
+		ret = PTR_ERR(pm->vencpll_d2);
 	}
 
 	pm->venc_sel = devm_clk_get(&pdev->dev, "venc_sel");
-	if (pm->venc_sel == NULL) {
+	if (IS_ERR(pm->venc_sel)) {
 		mtk_v4l2_err("devm_clk_get venc_sel fail");
-		ret = -1;
+		ret = PTR_ERR(pm->venc_sel);
 	}
 
 	pm->univpll1_d2 = devm_clk_get(&pdev->dev, "venc_lt_sel_src");
-	if (pm->univpll1_d2 == NULL) {
+	if (IS_ERR(pm->univpll1_d2)) {
 		mtk_v4l2_err("devm_clk_get univpll1_d2 fail");
-		ret = -1;
+		ret = PTR_ERR(pm->univpll1_d2);
 	}
 
 	pm->venc_lt_sel = devm_clk_get(&pdev->dev, "venc_lt_sel");
-	if (pm->venc_lt_sel == NULL) {
+	if (IS_ERR(pm->venc_lt_sel)) {
 		mtk_v4l2_err("devm_clk_get venc_lt_sel fail");
-		ret = -1;
+		ret = PTR_ERR(pm->venc_lt_sel);
 	}
 
 	return ret;



WARNING: multiple messages have this Message-ID (diff)
From: weiyj_lk-9Onoh4P/yGk@public.gmane.org
To: Mauro Carvalho Chehab
	<mchehab-JsYNTwtnfakRB7SZvlqPiA@public.gmane.org>,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Hans Verkuil
	<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Tiffany Lin <tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Cc: Wei Yongjun
	<yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH -next] [media] vcodec: mediatek: Fix return value check in mtk_vcodec_init_enc_pm()
Date: Tue, 12 Jul 2016 11:02:28 +0000	[thread overview]
Message-ID: <1468321348-16045-1-git-send-email-weiyj_lk@163.com> (raw)

From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

In case of error, the function devm_clk_get() returns ERR_PTR()
and not returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index 2379e97..3e73e9d 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -67,27 +67,27 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 	pm->dev = &pdev->dev;
 
 	pm->vencpll_d2 = devm_clk_get(&pdev->dev, "venc_sel_src");
-	if (pm->vencpll_d2 == NULL) {
+	if (IS_ERR(pm->vencpll_d2)) {
 		mtk_v4l2_err("devm_clk_get vencpll_d2 fail");
-		ret = -1;
+		ret = PTR_ERR(pm->vencpll_d2);
 	}
 
 	pm->venc_sel = devm_clk_get(&pdev->dev, "venc_sel");
-	if (pm->venc_sel == NULL) {
+	if (IS_ERR(pm->venc_sel)) {
 		mtk_v4l2_err("devm_clk_get venc_sel fail");
-		ret = -1;
+		ret = PTR_ERR(pm->venc_sel);
 	}
 
 	pm->univpll1_d2 = devm_clk_get(&pdev->dev, "venc_lt_sel_src");
-	if (pm->univpll1_d2 == NULL) {
+	if (IS_ERR(pm->univpll1_d2)) {
 		mtk_v4l2_err("devm_clk_get univpll1_d2 fail");
-		ret = -1;
+		ret = PTR_ERR(pm->univpll1_d2);
 	}
 
 	pm->venc_lt_sel = devm_clk_get(&pdev->dev, "venc_lt_sel");
-	if (pm->venc_lt_sel == NULL) {
+	if (IS_ERR(pm->venc_lt_sel)) {
 		mtk_v4l2_err("devm_clk_get venc_lt_sel fail");
-		ret = -1;
+		ret = PTR_ERR(pm->venc_lt_sel);
 	}
 
 	return ret;

WARNING: multiple messages have this Message-ID (diff)
From: weiyj_lk@163.com (weiyj_lk at 163.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH -next] [media] vcodec: mediatek: Fix return value check in mtk_vcodec_init_enc_pm()
Date: Tue, 12 Jul 2016 11:02:28 +0000	[thread overview]
Message-ID: <1468321348-16045-1-git-send-email-weiyj_lk@163.com> (raw)

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_clk_get() returns ERR_PTR()
and not returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index 2379e97..3e73e9d 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -67,27 +67,27 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 	pm->dev = &pdev->dev;
 
 	pm->vencpll_d2 = devm_clk_get(&pdev->dev, "venc_sel_src");
-	if (pm->vencpll_d2 == NULL) {
+	if (IS_ERR(pm->vencpll_d2)) {
 		mtk_v4l2_err("devm_clk_get vencpll_d2 fail");
-		ret = -1;
+		ret = PTR_ERR(pm->vencpll_d2);
 	}
 
 	pm->venc_sel = devm_clk_get(&pdev->dev, "venc_sel");
-	if (pm->venc_sel == NULL) {
+	if (IS_ERR(pm->venc_sel)) {
 		mtk_v4l2_err("devm_clk_get venc_sel fail");
-		ret = -1;
+		ret = PTR_ERR(pm->venc_sel);
 	}
 
 	pm->univpll1_d2 = devm_clk_get(&pdev->dev, "venc_lt_sel_src");
-	if (pm->univpll1_d2 == NULL) {
+	if (IS_ERR(pm->univpll1_d2)) {
 		mtk_v4l2_err("devm_clk_get univpll1_d2 fail");
-		ret = -1;
+		ret = PTR_ERR(pm->univpll1_d2);
 	}
 
 	pm->venc_lt_sel = devm_clk_get(&pdev->dev, "venc_lt_sel");
-	if (pm->venc_lt_sel == NULL) {
+	if (IS_ERR(pm->venc_lt_sel)) {
 		mtk_v4l2_err("devm_clk_get venc_lt_sel fail");
-		ret = -1;
+		ret = PTR_ERR(pm->venc_lt_sel);
 	}
 
 	return ret;

             reply	other threads:[~2016-07-12 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 11:02 weiyj_lk [this message]
2016-07-12 11:02 ` [PATCH -next] [media] vcodec: mediatek: Fix return value check in mtk_vcodec_init_enc_pm() weiyj_lk at 163.com
2016-07-12 11:02 ` weiyj_lk-9Onoh4P/yGk
2016-07-12 11:21 ` tiffany lin
2016-07-12 11:21   ` tiffany lin
2016-07-12 11:21   ` tiffany lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468321348-16045-1-git-send-email-weiyj_lk@163.com \
    --to=weiyj_lk@163.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@s-opensource.com \
    --cc=tiffany.lin@mediatek.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.