projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a9e0f9
)
ASoC: wm5100: Use WARN_ON() instead of BUG_ON()
author
Takashi Iwai
<
[email protected]
>
Tue, 5 Nov 2013 17:39:55 +0000
(18:39 +0100)
committer
Mark Brown
<
[email protected]
>
Wed, 6 Nov 2013 10:26:36 +0000
(10:26 +0000)
Use WARN_ON() and handle the error cases accordingly.
Signed-off-by: Takashi Iwai <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
sound/soc/codecs/wm5100.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/wm5100.c
b/sound/soc/codecs/wm5100.c
index ac1745d030d6256525f8d05aebe14cd542de89b3..4cf91deabc0261dde5d470e5bef375dab415b0b7 100644
(file)
--- a/
sound/soc/codecs/wm5100.c
+++ b/
sound/soc/codecs/wm5100.c
@@
-1972,7
+1972,8
@@
static void wm5100_set_detect_mode(struct wm5100_priv *wm5100, int the_mode)
{
struct wm5100_jack_mode *mode = &wm5100->pdata.jack_modes[the_mode];
- BUG_ON(the_mode >= ARRAY_SIZE(wm5100->pdata.jack_modes));
+ if (WARN_ON(the_mode >= ARRAY_SIZE(wm5100->pdata.jack_modes)))
+ return;
gpio_set_value_cansleep(wm5100->pdata.hp_pol, mode->hp_pol);
regmap_update_bits(wm5100->regmap, WM5100_ACCESSORY_DETECT_MODE_1,