ASoC: tlv320aic3x: Remove redundant OOM message
[deliverable/linux.git] / sound / soc / codecs / tlv320aic3x.c
index b1835103e9b4002ab44429d40bb16da8372f65aa..446303198ffd39bb28927e66f980b5b22cee3fe1 100644 (file)
@@ -169,7 +169,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
        mask <<= shift;
        val <<= shift;
 
-       change = snd_soc_test_bits(codec, val, mask, reg);
+       change = snd_soc_test_bits(codec, reg, mask, val);
        if (change) {
                update.kcontrol = kcontrol;
                update.reg = reg;
@@ -1399,7 +1399,6 @@ static int aic3x_probe(struct snd_soc_codec *codec)
        }
 
        aic3x_add_widgets(codec);
-       list_add(&aic3x->list, &reset_list);
 
        return 0;
 
@@ -1478,10 +1477,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
        u32 value;
 
        aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL);
-       if (aic3x == NULL) {
-               dev_err(&i2c->dev, "failed to create private data\n");
+       if (!aic3x)
                return -ENOMEM;
-       }
 
        aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap);
        if (IS_ERR(aic3x->regmap)) {
@@ -1499,10 +1496,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
        } else if (np) {
                ai3x_setup = devm_kzalloc(&i2c->dev, sizeof(*ai3x_setup),
                                                                GFP_KERNEL);
-               if (ai3x_setup == NULL) {
-                       dev_err(&i2c->dev, "failed to create private data\n");
+               if (!ai3x_setup)
                        return -ENOMEM;
-               }
 
                ret = of_get_named_gpio(np, "gpio-reset", 0);
                if (ret >= 0)
@@ -1569,7 +1564,13 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
 
        ret = snd_soc_register_codec(&i2c->dev,
                        &soc_codec_dev_aic3x, &aic3x_dai, 1);
-       return ret;
+
+       if (ret != 0)
+               goto err_gpio;
+
+       list_add(&aic3x->list, &reset_list);
+
+       return 0;
 
 err_gpio:
        if (gpio_is_valid(aic3x->gpio_reset) &&
This page took 0.027394 seconds and 5 git commands to generate.