static int
snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
{
+ struct snd_kcontrol *kctl;
int i, err = 0;
if (snd_BUG_ON(!emu || !card))
memset(emu->controls, 0, sizeof(emu->controls));
for (i = 0; i < EMU8000_NUM_CONTROLS; i++) {
- emu->controls[i] = snd_ctl_new1(mixer_defs[i], emu);
- err = snd_ctl_add(card, emu->controls[i]);
- if (err < 0) {
- emu->controls[i] = NULL;
+ kctl = snd_ctl_new1(mixer_defs[i], emu);
+ err = snd_ctl_add(card, kctl);
+ if (err < 0)
goto __error;
- }
+ emu->controls[i] = kctl;
}
return 0;
static int snd_sb_qsound_build(struct snd_sb_csp * p)
{
struct snd_card *card;
+ struct snd_kcontrol *kctl;
int err;
if (snd_BUG_ON(!p))
spin_lock_init(&p->q_lock);
- p->qsound_switch = snd_ctl_new1(&snd_sb_qsound_switch, p);
- err = snd_ctl_add(card, p->qsound_switch);
- if (err < 0) {
- p->qsound_switch = NULL;
+ kctl = snd_ctl_new1(&snd_sb_qsound_switch, p);
+ err = snd_ctl_add(card, kctl);
+ if (err < 0)
goto __error;
- }
- p->qsound_space = snd_ctl_new1(&snd_sb_qsound_space, p);
- err = snd_ctl_add(card, p->qsound_space);
- if (err < 0) {
- p->qsound_space = NULL;
+ p->qsound_switch = kctl;
+ kctl = snd_ctl_new1(&snd_sb_qsound_space, p);
+ err = snd_ctl_add(card, kctl);
+ if (err < 0)
goto __error;
- }
+ p->qsound_space = kctl;
return 0;