[PATCH] ASoC: sun4i-i2s: fix ptr_ret.cocci warnings
From: kbuild test robot
Date: Sun Jul 30 2017 - 12:44:58 EST
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@xxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
sun4i-i2s.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- 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)