Skip to contentSkip to conversation

ASoC: wm8741: check for error returns from wm8741_set_pdata()

PATCH Applied Dan Carpenter 3 participants 3 messages May 20, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: wm8741: check for error returns from wm8741_set_pdata()

Static checkers complain that "ret" is always zero so the conditions are never true.

The intention here was clearly to check for errors from wm8741_set_pdata(). Although, since wm8741_set_pdata() never returns errors, it doesn't affect runtime.

Fixes c354b54cfdf6 ('ASoC: wm8741: Add differential mono mode support')
sound/soc/codecs/wm8741.c +2 -2
index c065ea1..09ff01f 100644
@@ -613,7 +613,7 @@ static int wm8741_i2c_probe(struct i2c_client *i2c,
 		return ret;
 	}
 
-	wm8741_set_pdata(&i2c->dev, wm8741);
+	ret = wm8741_set_pdata(&i2c->dev, wm8741);
 	if (ret != 0) {
 		dev_err(&i2c->dev, "Failed to set pdata: %d\n", ret);
 		return ret;
@@ -679,7 +679,7 @@ static int wm8741_spi_probe(struct spi_device *spi)
 		return ret;
 	}
 
-	wm8741_set_pdata(&spi->dev, wm8741);
+	ret = wm8741_set_pdata(&spi->dev, wm8741);
 	if (ret != 0) {
 		dev_err(&spi->dev, "Failed to set pdata: %d\n", ret);
 		return ret;
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Dan Carpenter

Static checkers complain that "ret" is always zero so the conditions are never true.

The intention here was clearly to check for errors from wm8741_set_pdata(). Although, since wm8741_set_pdata() never returns errors, it doesn't affect runtime.

Fixes c354b54cfdf6 ('ASoC: wm8741: Add differential mono mode support')

Thanks,
Charles

maintainer Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 2 lines · Dan Carpenter

Static checkers complain that "ret" is always zero so the conditions are never true.

Applied, thanks.