diff options
Diffstat (limited to 'sound/soc/codecs/wm8996.c')
-rw-r--r-- | sound/soc/codecs/wm8996.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 7280a10d5fe7..5174874a5f7b 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -719,7 +719,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask) | |||
719 | { | 719 | { |
720 | struct i2c_client *i2c = to_i2c_client(codec->dev); | 720 | struct i2c_client *i2c = to_i2c_client(codec->dev); |
721 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); | 721 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); |
722 | int i, ret; | 722 | int ret; |
723 | unsigned long timeout = 200; | 723 | unsigned long timeout = 200; |
724 | 724 | ||
725 | snd_soc_write(codec, WM8996_DC_SERVO_2, mask); | 725 | snd_soc_write(codec, WM8996_DC_SERVO_2, mask); |
@@ -734,15 +734,12 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask) | |||
734 | 734 | ||
735 | } else { | 735 | } else { |
736 | msleep(1); | 736 | msleep(1); |
737 | if (--i) { | 737 | timeout--; |
738 | timeout = 0; | ||
739 | break; | ||
740 | } | ||
741 | } | 738 | } |
742 | 739 | ||
743 | ret = snd_soc_read(codec, WM8996_DC_SERVO_2); | 740 | ret = snd_soc_read(codec, WM8996_DC_SERVO_2); |
744 | dev_dbg(codec->dev, "DC servo state: %x\n", ret); | 741 | dev_dbg(codec->dev, "DC servo state: %x\n", ret); |
745 | } while (ret & mask); | 742 | } while (timeout && ret & mask); |
746 | 743 | ||
747 | if (timeout == 0) | 744 | if (timeout == 0) |
748 | dev_err(codec->dev, "DC servo timed out for %x\n", mask); | 745 | dev_err(codec->dev, "DC servo timed out for %x\n", mask); |