summaryrefslogtreecommitdiff
path: root/sound/pci/ice1712/phase.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/phase.c')
-rw-r--r--sound/pci/ice1712/phase.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c
index 1e47e46ab8ac..37756d06218d 100644
--- a/sound/pci/ice1712/phase.c
+++ b/sound/pci/ice1712/phase.c
@@ -125,7 +125,7 @@ static int phase22_init(struct snd_ice1712 *ice)
}
/* Initialize analog chips */
- ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
+ ice->akm = kzalloc_obj(struct snd_akm4xxx);
ak = ice->akm;
if (!ak)
return -ENOMEM;
@@ -287,10 +287,9 @@ static int wm_pcm_mute_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
- mutex_lock(&ice->gpio_mutex);
+ guard(mutex)(&ice->gpio_mutex);
ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ?
0 : 1;
- mutex_unlock(&ice->gpio_mutex);
return 0;
}
@@ -412,13 +411,13 @@ static int phase28_init(struct snd_ice1712 *ice)
ice->num_total_dacs = 8;
ice->num_total_adcs = 2;
- spec = kzalloc(sizeof(*spec), GFP_KERNEL);
+ spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
ice->spec = spec;
/* Initialize analog chips */
- ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
+ ice->akm = kzalloc_obj(struct snd_akm4xxx);
ak = ice->akm;
if (!ak)
return -ENOMEM;
@@ -638,11 +637,10 @@ static int wm_pcm_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short val;
- mutex_lock(&ice->gpio_mutex);
+ guard(mutex)(&ice->gpio_mutex);
val = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff;
val = val > PCM_MIN ? (val - PCM_MIN) : 0;
ucontrol->value.integer.value[0] = val;
- mutex_unlock(&ice->gpio_mutex);
return 0;
}