ASoC: tas571x: Kill BUG_ON() usage
[muen/linux.git] / sound / soc / codecs / tas571x.c
index 810369f687d7166755a6b639fbfb97ed3b9672e7..a09499977be4d0ab4be645c41c6f0dcd614dcf71 100644 (file)
@@ -697,7 +697,8 @@ static int tas571x_i2c_probe(struct i2c_client *client,
                return PTR_ERR(priv->mclk);
        }
 
-       BUG_ON(priv->chip->num_supply_names > TAS571X_MAX_SUPPLIES);
+       if (WARN_ON(priv->chip->num_supply_names > TAS571X_MAX_SUPPLIES))
+               return -EINVAL;
        for (i = 0; i < priv->chip->num_supply_names; i++)
                priv->supplies[i].supply = priv->chip->supply_names[i];