summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-09-07 10:59:16 +0200
committerMark Brown <broonie@kernel.org>2017-09-20 13:45:19 +0200
commita029ef45179d72945c7ae0a11f97e8012a5574ac (patch)
tree1c774cc942ff16f2d9eccdac38f585a4ceceb39d /sound
parentLinux 4.14-rc1 (diff)
downloadlinux-a029ef45179d72945c7ae0a11f97e8012a5574ac.tar.xz
linux-a029ef45179d72945c7ae0a11f97e8012a5574ac.zip
ASoC: tas571x: Kill BUG_ON() usage
Don't use BUG_ON() for a non-critical sanity check on production systems. This patch replaces with a softer WARN_ON() and an error path. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/tas571x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c
index 810369f687d7..a09499977be4 100644
--- a/sound/soc/codecs/tas571x.c
+++ b/sound/soc/codecs/tas571x.c
@@ -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];