]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: codecs: inline i2c_check_functionality checks
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 29 Mar 2026 16:31:46 +0000 (18:31 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 30 Mar 2026 14:05:34 +0000 (15:05 +0100)
Inline i2c_check_functionality() checks, since the function returns a
boolean status rather than an error code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260329163152.366356-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/aw87390.c
sound/soc/codecs/aw88081.c
sound/soc/codecs/aw88261.c
sound/soc/codecs/max98390.c
sound/soc/codecs/max98520.c

index 613daccca3af8bb851a8fff56f4c08ac0d838f39..37ca42a25889a63d0836cd7ad079f14fe42c5df4 100644 (file)
@@ -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);
index fbd1fd12381a3954ede6566a6f91bab9a163819b..8c5bb3ea0227d0e5b360192516153d322688a3d3 100644 (file)
@@ -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);
index 02f8c2bb2569150d99cf3785e596f3cf53537cd1..a6805d5405cd106d2d9ca76ed102feca8474f975 100644 (file)
@@ -1242,8 +1242,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);
index ff58805e97d17fbd94077a96e925691ceb22dacd..65f095c4719186cce08fdf3dc1ecf731b02a34e1 100644 (file)
@@ -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;
        }
index 2bf8976c1828210d2e6106f08e571df650640606..5bc3d95ade5a6a1d18e985fa07a3b91a5b20adf9 100644 (file)
@@ -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;
        }