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:
Родитель
4a318f1e6c
Коммит
8b14719beb
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче