diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-08 16:45:38 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-11-08 16:45:38 +0100 |
commit | a6bc732b5a96b5403c2637e85c350b95ec6591f3 (patch) | |
tree | 4b1c3967cd1de42a5e36e567cbdd18e1f4e8446f /sound/soc/soc-dapm.c | |
parent | 9a22a8f558d09a83965d2bbe168294eb8ffb70e9 (diff) | |
parent | dd212bd5bb8b15889821ef79213cdb5bd47c6f85 (diff) |
Merge tag 'asoc-v3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v3.13
Some additional fixes for v3.13, the majority of which are removals and
downgrades of BUG()s from Takashi.
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index cc36caaf6443..dcade130157f 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1427,7 +1427,7 @@ static void dapm_seq_check_event(struct snd_soc_card *card, power = 0; break; default: - BUG(); + WARN(1, "Unknown event %d\n", event); return; } @@ -1460,7 +1460,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card, power_list)->reg; list_for_each_entry(w, pending, power_list) { - BUG_ON(reg != w->reg); + WARN_ON(reg != w->reg); w->power = w->new_power; mask |= w->mask << w->shift; @@ -2026,7 +2026,7 @@ static ssize_t dapm_bias_read_file(struct file *file, char __user *user_buf, level = "Off\n"; break; default: - BUG(); + WARN(1, "Unknown bias_level %d\n", dapm->bias_level); level = "Unknown\n"; break; } @@ -3359,8 +3359,9 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, u64 fmt; int ret; - BUG_ON(!config); - BUG_ON(list_empty(&w->sources) || list_empty(&w->sinks)); + if (WARN_ON(!config) || + WARN_ON(list_empty(&w->sources) || list_empty(&w->sinks))) + return -EINVAL; /* We only support a single source and sink, pick the first */ source_p = list_first_entry(&w->sources, struct snd_soc_dapm_path, @@ -3368,9 +3369,10 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, sink_p = list_first_entry(&w->sinks, struct snd_soc_dapm_path, list_source); - BUG_ON(!source_p || !sink_p); - BUG_ON(!sink_p->source || !source_p->sink); - BUG_ON(!source_p->source || !sink_p->sink); + if (WARN_ON(!source_p || !sink_p) || + WARN_ON(!sink_p->source || !source_p->sink) || + WARN_ON(!source_p->source || !sink_p->sink)) + return -EINVAL; source = source_p->source->priv; sink = sink_p->sink->priv; @@ -3446,7 +3448,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, break; default: - BUG(); + WARN(1, "Unknown event %d\n", event); return -EINVAL; } |