ASoC: rcar: Use WARN_ON() instead of BUG_ON()

Use WARN_ON() and handle the error cases accordingly.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Takashi Iwai 2013-11-05 18:40:05 +01:00 committed by Mark Brown
parent 4a318f1e6c
commit 8b14719beb
2 changed files with 4 additions and 2 deletions

View file

@ -192,7 +192,8 @@ static struct rsnd_mod_ops rsnd_scu_ops = {
struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
{
BUG_ON(id < 0 || id >= rsnd_scu_nr(priv));
if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv)))
id = 0;
return &((struct rsnd_scu *)(priv->scu) + id)->mod;
}

View file

@ -619,7 +619,8 @@ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
{
BUG_ON(id < 0 || id >= rsnd_ssi_nr(priv));
if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv)))
id = 0;
return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod;
}