Skip to contentSkip to conversation

ASoC: codecs: inline i2c_check_functionality checks

PATCH In review Thorsten Blum 2 participants 2 messages Mar 29 – Mar 30

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

PATCH 1/1 ASoC: codecs: inline i2c_check_functionality checks

Inline i2c_check_functionality() checks, since the function returns a boolean status rather than an error code.

---
 sound/soc/codecs/aw87390.c  | 3 +--
 sound/soc/codecs/aw88081.c  | 3 +--
 sound/soc/codecs/aw88261.c  | 3 +--
 sound/soc/codecs/max98390.c | 6 ++----
 sound/soc/codecs/max98520.c | 4 ++--
 5 files changed, 7 insertions(+), 12 deletions(-)
sound/soc/codecs/aw87390.c +1 -2
index 613daccca3af..37ca42a25889 100644
@@ -544,8 +544,7 @@ static int aw87390_i2c_probe(struct i2c_client *i2c)
 	const struct snd_soc_component_driver *priv;
 	int ret;
 
-	ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C);
-	if (!ret)
+	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C))
 		return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed\n");
 
 	aw87390 = devm_kzalloc(&i2c->dev, sizeof(*aw87390), GFP_KERNEL);
sound/soc/codecs/aw88081.c +1 -2
index fbd1fd12381a..8c5bb3ea0227 100644
@@ -1253,8 +1253,7 @@ static int aw88081_i2c_probe(struct i2c_client *i2c)
 	struct aw88081 *aw88081;
 	int ret;
 
-	ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C);
-	if (!ret)
+	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C))
 		return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed");
 
 	aw88081 = devm_kzalloc(&i2c->dev, sizeof(*aw88081), GFP_KERNEL);
sound/soc/codecs/aw88261.c +1 -2
index 43c03d3cb252..45f70fc78f87 100644
@@ -1237,8 +1237,7 @@ static int aw88261_i2c_probe(struct i2c_client *i2c)
 	struct aw88261 *aw88261;
 	int ret;
 
-	ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C);
-	if (!ret)
+	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C))
 		return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed");
 
 	aw88261 = devm_kzalloc(&i2c->dev, sizeof(*aw88261), GFP_KERNEL);
sound/soc/codecs/max98390.c +2 -4
index ff58805e97d1..65f095c47191 100644
@@ -1015,10 +1015,8 @@ static int max98390_i2c_probe(struct i2c_client *i2c)
 	struct i2c_adapter *adapter = i2c->adapter;
 	struct gpio_desc *reset_gpio;
 
-	ret = i2c_check_functionality(adapter,
-		I2C_FUNC_SMBUS_BYTE
-		| I2C_FUNC_SMBUS_BYTE_DATA);
-	if (!ret) {
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE |
+					      I2C_FUNC_SMBUS_BYTE_DATA)) {
 		dev_err(&i2c->dev, "I2C check functionality failed\n");
 		return -ENXIO;
 	}
sound/soc/codecs/max98520.c +2 -2
index 2bf8976c1828..5bc3d95ade5a 100644
@@ -681,8 +681,8 @@ static int max98520_i2c_probe(struct i2c_client *i2c)
 	struct max98520_priv *max98520;
 	struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent);
 
-	ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA);
-	if (!ret) {
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE |
+					      I2C_FUNC_SMBUS_BYTE_DATA)) {
 		dev_err(&i2c->dev, "I2C check functionality failed\n");
 		return -ENXIO;
 	}
maintainer
#1 lore raw
Quoted 1 line · Thorsten Blum

ASoC: codecs: inline i2c_check_functionality checks

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1

Thanks!

[1/1] ASoC: codecs: inline i2c_check_functionality checks

      https://git.kernel.org/broonie/sound/c/1e28cdeec313

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark