diff options
Diffstat (limited to 'sound/pci/ice1712/psc724.c')
-rw-r--r-- | sound/pci/ice1712/psc724.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sound/pci/ice1712/psc724.c b/sound/pci/ice1712/psc724.c index 82cf365cda10..0818e42c94ca 100644 --- a/sound/pci/ice1712/psc724.c +++ b/sound/pci/ice1712/psc724.c @@ -177,7 +177,6 @@ static bool psc724_get_master_switch(struct snd_ice1712 *ice) static void psc724_set_jack_state(struct snd_ice1712 *ice, bool hp_connected) { struct psc724_spec *spec = ice->spec; - struct snd_ctl_elem_id elem_id; struct snd_kcontrol *kctl; u16 power = spec->wm8776.regs[WM8776_REG_PWRDOWN] & ~WM8776_PWR_HPPD; @@ -187,17 +186,15 @@ static void psc724_set_jack_state(struct snd_ice1712 *ice, bool hp_connected) snd_wm8776_set_power(&spec->wm8776, power); spec->hp_connected = hp_connected; /* notify about master speaker mute change */ - memset(&elem_id, 0, sizeof(elem_id)); - elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; - strscpy(elem_id.name, "Master Speakers Playback Switch", - sizeof(elem_id.name)); - kctl = snd_ctl_find_id(ice->card, &elem_id); - snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); + kctl = snd_ctl_find_id_mixer(ice->card, + "Master Speakers Playback Switch"); + if (kctl) + snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); /* and headphone mute change */ - strscpy(elem_id.name, spec->wm8776.ctl[WM8776_CTL_HP_SW].name, - sizeof(elem_id.name)); - kctl = snd_ctl_find_id(ice->card, &elem_id); - snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); + kctl = snd_ctl_find_id_mixer(ice->card, + spec->wm8776.ctl[WM8776_CTL_HP_SW].name); + if (kctl) + snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); } static void psc724_update_hp_jack_state(struct work_struct *work) |