Skip to content

Commit

Permalink
ASoC: wm8962: 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.

Cc: patches@opensource.wolfsonmicro.com
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 a845d59 commit 6913436
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sound/soc/codecs/wm8962.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ static int cp_event(struct snd_soc_dapm_widget *w,
break;

default:
BUG();
WARN(1, "Invalid event %d\n", event);
return -EINVAL;
}

Expand Down Expand Up @@ -1937,7 +1937,7 @@ static int hp_event(struct snd_soc_dapm_widget *w,
break;

default:
BUG();
WARN(1, "Invalid event %d\n", event);
return -EINVAL;

}
Expand Down Expand Up @@ -1966,15 +1966,15 @@ static int out_pga_event(struct snd_soc_dapm_widget *w,
reg = WM8962_SPKOUTL_VOLUME;
break;
default:
BUG();
WARN(1, "Invalid shift %d\n", w->shift);
return -EINVAL;
}

switch (event) {
case SND_SOC_DAPM_POST_PMU:
return snd_soc_write(codec, reg, snd_soc_read(codec, reg));
default:
BUG();
WARN(1, "Invalid event %d\n", event);
return -EINVAL;
}
}
Expand All @@ -1997,7 +1997,7 @@ static int dsp2_event(struct snd_soc_dapm_widget *w,
break;

default:
BUG();
WARN(1, "Invalid event %d\n", event);
return -EINVAL;
}

Expand Down

0 comments on commit 6913436

Please sign in to comment.