summaryrefslogtreecommitdiff
path: root/sound/soc/sh/rcar/scu.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/rcar/scu.c')
-rw-r--r--sound/soc/sh/rcar/scu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
index 1ab1bce6be7f..f4453e33a847 100644
--- a/sound/soc/sh/rcar/scu.c
+++ b/sound/soc/sh/rcar/scu.c
@@ -198,7 +198,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;
}