diff options
Diffstat (limited to 'sound/pci/ice1712/maya44.c')
-rw-r--r-- | sound/pci/ice1712/maya44.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c index b46df1821251..551f478c59c4 100644 --- a/sound/pci/ice1712/maya44.c +++ b/sound/pci/ice1712/maya44.c @@ -175,10 +175,9 @@ static int maya_vol_get(struct snd_kcontrol *kcontrol, &chip->wm[snd_ctl_get_ioff(kcontrol, &ucontrol->id)]; unsigned int idx = kcontrol->private_value; - mutex_lock(&chip->mutex); + guard(mutex)(&chip->mutex); ucontrol->value.integer.value[0] = wm->volumes[idx][0]; ucontrol->value.integer.value[1] = wm->volumes[idx][1]; - mutex_unlock(&chip->mutex); return 0; } @@ -193,7 +192,7 @@ static int maya_vol_put(struct snd_kcontrol *kcontrol, unsigned int val, data; int ch, changed = 0; - mutex_lock(&chip->mutex); + guard(mutex)(&chip->mutex); for (ch = 0; ch < 2; ch++) { val = ucontrol->value.integer.value[ch]; if (val > vol->maxval) @@ -213,7 +212,6 @@ static int maya_vol_put(struct snd_kcontrol *kcontrol, val ? 0 : vol->mux_bits[ch]); wm->volumes[idx][ch] = val; } - mutex_unlock(&chip->mutex); return changed; } @@ -250,7 +248,7 @@ static int maya_sw_put(struct snd_kcontrol *kcontrol, unsigned int mask, val; int changed; - mutex_lock(&chip->mutex); + guard(mutex)(&chip->mutex); mask = 1 << idx; wm->switch_bits &= ~mask; val = ucontrol->value.integer.value[0]; @@ -260,7 +258,6 @@ static int maya_sw_put(struct snd_kcontrol *kcontrol, changed = wm8776_write_bits(chip->ice, wm, GET_SW_VAL_REG(kcontrol->private_value), mask, val ? mask : 0); - mutex_unlock(&chip->mutex); return changed; } @@ -315,14 +312,13 @@ static int maya_gpio_sw_put(struct snd_kcontrol *kcontrol, unsigned int val, mask; int changed; - mutex_lock(&chip->mutex); + guard(mutex)(&chip->mutex); mask = 1 << shift; val = ucontrol->value.integer.value[0]; if (GET_GPIO_VAL_INV(kcontrol->private_value)) val = !val; val = val ? mask : 0; changed = maya_set_gpio_bits(chip->ice, mask, val); - mutex_unlock(&chip->mutex); return changed; } @@ -369,11 +365,10 @@ static int maya_rec_src_put(struct snd_kcontrol *kcontrol, int sel = ucontrol->value.enumerated.item[0]; int changed; - mutex_lock(&chip->mutex); + guard(mutex)(&chip->mutex); changed = maya_set_gpio_bits(chip->ice, 1 << GPIO_MIC_RELAY, sel ? (1 << GPIO_MIC_RELAY) : 0); wm8776_select_input(chip, 0, sel ? MAYA_MIC_IN : MAYA_LINE_IN); - mutex_unlock(&chip->mutex); return changed; } @@ -635,12 +630,11 @@ static void set_rate(struct snd_ice1712 *ice, unsigned int rate) val |= 8; val |= ratio << 4; - mutex_lock(&chip->mutex); + guard(mutex)(&chip->mutex); for (i = 0; i < 2; i++) wm8776_write_bits(ice, &chip->wm[i], WM8776_REG_MASTER_MODE_CONTROL, 0x180, val); - mutex_unlock(&chip->mutex); } /* |