Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449314 > unrolled thread

[PATCH -next] drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code

Started byWei Yongjun <weiyj.lk@gmail.com>
First post2016-07-25 09:10 +0200
Last post2016-07-25 09:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code Wei Yongjun <weiyj.lk@gmail.com> - 2016-07-25 09:10 +0200

#1449314 — [PATCH -next] drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code

FromWei Yongjun <weiyj.lk@gmail.com>
Date2016-07-25 09:10 +0200
Subject[PATCH -next] drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code
Message-ID<rYIbv-1BM-3@gated-at.bofh.it>
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 <weiyj.lk@gmail.com>
---
 drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
index bca09ea..3194e54 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
@@ -57,10 +57,7 @@ static int fsl_tcon_init_regmap(struct device *dev,
 
 	tcon->regs = devm_regmap_init_mmio(dev, regs,
 					   &fsl_tcon_regmap_config);
-	if (IS_ERR(tcon->regs))
-		return PTR_ERR(tcon->regs);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(tcon->regs);
 }
 
 struct fsl_tcon *fsl_tcon_init(struct device *dev)

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web