diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-05 12:40:05 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-07 14:55:16 -0500 |
commit | 8b14719bebfe022f3637c323e76c88b2bc061a61 (patch) | |
tree | a4284d9ca43a0c4b7572547d6812528b75d1a9ac /sound/soc | |
parent | 4a318f1e6c4331633a91ad67b782860c76d8894b (diff) |
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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/sh/rcar/scu.c | 3 | ||||
-rw-r--r-- | sound/soc/sh/rcar/ssi.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c index 2df2e9150b89..92e3f51c3a4f 100644 --- a/sound/soc/sh/rcar/scu.c +++ b/sound/soc/sh/rcar/scu.c | |||
@@ -192,7 +192,8 @@ static struct rsnd_mod_ops rsnd_scu_ops = { | |||
192 | 192 | ||
193 | struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id) | 193 | struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id) |
194 | { | 194 | { |
195 | BUG_ON(id < 0 || id >= rsnd_scu_nr(priv)); | 195 | if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv))) |
196 | id = 0; | ||
196 | 197 | ||
197 | return &((struct rsnd_scu *)(priv->scu) + id)->mod; | 198 | return &((struct rsnd_scu *)(priv->scu) + id)->mod; |
198 | } | 199 | } |
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index fae26d3f79d2..fc010d652069 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c | |||
@@ -619,7 +619,8 @@ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv, | |||
619 | 619 | ||
620 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id) | 620 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id) |
621 | { | 621 | { |
622 | BUG_ON(id < 0 || id >= rsnd_ssi_nr(priv)); | 622 | if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv))) |
623 | id = 0; | ||
623 | 624 | ||
624 | return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod; | 625 | return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod; |
625 | } | 626 | } |