diff mbox

drm/i2c: tda998x: fix ptr_ret.cocci warnings

Message ID 20160309001555.GA169235@lkp-ib03 (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot March 9, 2016, 12:15 a.m. UTC
drivers/gpu/drm/i2c/tda998x_drv.c:1329:1-3: WARNING: PTR_ERR_OR_ZERO can be used


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

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

CC: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 tda998x_drv.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox

Patch

--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1326,10 +1326,7 @@  static int tda998x_audio_codec_init(stru
 		dev, HDMI_CODEC_DRV_NAME, PLATFORM_DEVID_AUTO,
 		&codec_data, sizeof(codec_data));
 
-	if (IS_ERR(priv->audio_pdev))
-		return PTR_ERR(priv->audio_pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(priv->audio_pdev);
 }
 
 /* I2C driver functions */