mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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:
parent
4a318f1e6c
commit
8b14719beb
2 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue