ASoC: wm8994: Fix variable double use

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Mark Brown 2012-12-07 17:10:05 +09:00
parent 98869f68f2
commit 8afd0ef263

View file

@ -3721,7 +3721,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
{ {
struct wm8994_priv *wm8994 = data; struct wm8994_priv *wm8994 = data;
struct snd_soc_codec *codec = wm8994->hubs.codec; struct snd_soc_codec *codec = wm8994->hubs.codec;
int reg, count; int reg, count, ret;
/* /*
* Jack detection may have detected a removal simulataneously * Jack detection may have detected a removal simulataneously
@ -3767,11 +3767,11 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
/* Avoid a transient report when the accessory is being removed */ /* Avoid a transient report when the accessory is being removed */
if (wm8994->jackdet) { if (wm8994->jackdet) {
reg = snd_soc_read(codec, WM1811_JACKDET_CTRL); ret = snd_soc_read(codec, WM1811_JACKDET_CTRL);
if (reg < 0) { if (ret < 0) {
dev_err(codec->dev, "Failed to read jack status: %d\n", dev_err(codec->dev, "Failed to read jack status: %d\n",
reg); ret);
} else if (!(reg & WM1811_JACKDET_LVL)) { } else if (!(ret & WM1811_JACKDET_LVL)) {
dev_dbg(codec->dev, "Ignoring removed jack\n"); dev_dbg(codec->dev, "Ignoring removed jack\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} }