Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95ff71e9 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown
Browse files

ASoC: wm5100: Use WARN_ON() instead of BUG_ON()



Use WARN_ON() and handle the error cases accordingly.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 4a9e0f91
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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,