提交 8b14719b 编写于 作者: T Takashi Iwai 提交者: Mark Brown

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

Use WARN_ON() and handle the error cases accordingly.
Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 4a318f1e
...@@ -192,7 +192,8 @@ static struct rsnd_mod_ops rsnd_scu_ops = { ...@@ -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) 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; 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, ...@@ -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) 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; return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册