Skip to content

Commit

Permalink
ASoC: Replace BUG() with WARN()
Browse files Browse the repository at this point in the history
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation.  For that
purpose, it'd be more convenient to use WARN() instead with more
error information.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Nov 7, 2013
1 parent 9a74340 commit a6ed060
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions sound/soc/soc-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ static bool snd_soc_set_cache_val(void *base, unsigned int idx,
break;
}
default:
BUG();
WARN(1, "Invalid word_size %d\n", word_size);
break;
}
return false;
}
Expand All @@ -60,7 +61,8 @@ static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx,
return cache[idx];
}
default:
BUG();
WARN(1, "Invalid word_size %d\n", word_size);
break;
}
/* unreachable */
return -1;
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,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;
}

Expand Down Expand Up @@ -2001,7 +2001,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;
}
Expand Down Expand Up @@ -3416,7 +3416,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;
}

Expand Down

0 comments on commit a6ed060

Please sign in to comment.