diff mbox

ASoC: sun4i-i2s: fix ptr_ret.cocci warnings

Message ID 20170730164329.GA26670@intel17.lkp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot July 30, 2017, 4:43 p.m. UTC
sound/soc/sunxi/sun4i-i2s.c:740: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

Fixes: 298207690de9 ("ASoC: sun4i-i2s: Add regmap fields for channels")
CC: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

Patch

--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -737,10 +737,7 @@  static int sun4i_i2s_init_regmap_fields(
 	i2s->field_rxchansel =
 		devm_regmap_field_alloc(dev, i2s->regmap,
 					i2s->variant->field_rxchansel);
-	if (IS_ERR(i2s->field_rxchansel))
-		return PTR_ERR(i2s->field_rxchansel);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(i2s->field_rxchansel);
 }
 
 static int sun4i_i2s_probe(struct platform_device *pdev)